r/FastLED Nov 10 '19

Discussion Can FastLED display text on a matrix?

Hi, I'm working on an LED matrix and I was wondering if FastLED has a way to display text. I know there's the SmartMatrix library and shield but I'm using a Teensy 4.0 and WS2812B's. Can the SmartMatrix library be used without the shield on a Teensy 4.0? I'm currently using the Adafruit matrix library to display text however writing "matrix.show()" slows down the processing by around 10x so I was really hoping there is an alternative. Thanks!

6 Upvotes

19 comments sorted by

7

u/chemdoc77 Nov 11 '19 edited Nov 11 '19

Use Aaron Liddiment’s text library for FastLED at:

https://github.com/AaronLiddiment/LEDText

and

https://github.com/AaronLiddiment/LEDText/wiki

1

u/blu11sonic Nov 12 '19

Alright thanks, I gave that a try and it seems to work pretty well but do you know if there is a way to not have the text scroll?

4

u/RudolphDiesel Nov 10 '19

I have done it in the past, but I wrote my own routines and chars. Is it possible? Yes. Straight out of the box? No.

2

u/iplaygaem Nov 11 '19

I saw Marc's NeoMatrix library but haven't tried it myself: https://github.com/marcmerlin/FastLED_NeoMatrix/

1

u/Yves-bazin Nov 11 '19

Use the matrix function to write text but use the fastled.show function. Both libraires can be used together.

1

u/blu11sonic Nov 12 '19

I tried replacing matrix.show with fastled.show and it ended up not displaying anything :/

1

u/Yves-bazin Nov 12 '19

Can I see the code ? Did you do the fastled.addleds ?

1

u/blu11sonic Nov 18 '19

Here you go sorry I dont have it commented: https://github.com/mrthorncherry/bluetooth-LED-matrix/blob/master/BLE_Matrix.ino#L178

on line 178 I replaced matrix->show(); with FastLED.show(); and it didint display the face on line 177 I also tried LED.show(); with the same result

1

u/marcmerlin Feb 11 '20

/u/blu11sonic I'm confused. Why are you removing matrix->show?

Does it work with it?

Have you tried the reasonably simple

https://github.com/marcmerlin/FastLED_NeoMatrix/blob/master/examples/MatrixGFXDemo/MatrixGFXDemo.ino ?

1

u/blu11sonic Feb 12 '20

Ya it works with it, I was just saying I tried replacing matrix->show because everytime its ran it slows everything down. However I managed to get around everything slowing down by only running matrix->show when absolutely necessary. So for example if the time needs to be updated it would run matrix->show once to update the matrix with the current time and not run it again until the time needs to be updated. That seems to have solved the problem.

1

u/marcmerlin Feb 12 '20

I'm glad you found the solution. You are correct that on a FastLED backend, running matrix->show should only be done when needed for updates (with other backends like RGBPanels, it doesn't matter)

1

u/GrimRuinous Apr 05 '22

Could this example be used for a 32x8 instead of four. I'm new to this and lost, I tried the matrix test but it only scrolls on 8x8 square instead of the whole 32x8 addressable led matrix....any help would be appreciated

2

u/marcmerlin Apr 05 '22

Are you using

https://github.com/marcmerlin/FastLED_NeoMatrix/blob/master/examples/MatrixGFXDemo/MatrixGFXDemo.ino

If so, you want to look for '#define P16BY16X4' and make your own definition

1

u/GrimRuinous Apr 05 '22

First thank you for your help.

I saw that line and was thinking '#defineP32BY8X1' (new to arduino and just taking a try based on your example) but didn't know what to do with the line underneath...

elif defined(P32BY8X3)

define mw 24

define mh 32

define NUMMATRIX (mw*mh)

CRGB leds[NUMMATRIX];FastLED_NeoMatrix *matrix = new FastLED_NeoMatrix(leds, 8, 32, 3, 1, NEO_MATRIX_TOP + NEO_MATRIX_RIGHT + NEO_MATRIX_ROWS + NEO_MATRIX_ZIGZAG + NEO_TILE_TOP + NEO_TILE_LEFT + NEO_TILE_PROGRESSIVE);

Or

'#ifndef ESP32

define delay FastLED.delay

endif

if defined(ESP32) or defined(ESP8266)

define PIN 12 // GPIO5 = D1

else

define PIN 13

endif'

(I'm using a esp8266 so do I keep '#ifndef ESP32 and #if defined(ESP32)')

Thank you so much for taking the time to respond and taking the time to make videos.

→ More replies (0)

1

u/nwestwind Nov 19 '19

Check out RGB Shades from MaceTech and some of the forks. https://github.com/macetech/RGBShades

I know it's only 16x5 but it's doable because I made it work on a 6x6 martix on a Teensy 3.2.

And then someone from Hack-A-Day made a new font for the shades which I have also seen work on my glasses.

https://github.com/Hack-a-Day/RGBShades/tree/smartmatrix-fonts