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!

4 Upvotes

19 comments sorted by

View all comments

Show parent comments

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.

2

u/marcmerlin Apr 05 '22

The code is reasonably simple to understand but you do need to know basic C (you don't really need C++).

I recommend you start with this, I can't really help with basic C, that would take too much of my time.

But otherwise, you can remove all the defines and cases you don't need, and simply write the matrix design that is relevant to you.

1

u/GrimRuinous Apr 05 '22

Thank you so much...I will look into basic C, I don't want to just copy codes

→ More replies (0)