Jorgen-VikingGod / FastLED-GFX

FastLED port of https://github.com/adafruit/Adafruit-GFX-Library
GNU General Public License v3.0
25 stars 8 forks source link

Example #1

Open sulram opened 7 years ago

sulram commented 7 years ago

Is there any example on how to use this lib together with LedMatrix lib? Thanks.

Jorgen-VikingGod commented 7 years ago

there was some with an older version of my LedMatrix No it is obsolete, because I built some of the methods directly into the LedMatrix class. Take a look on the LedMatrix master and examples.

x43x61x69 commented 6 years ago

I'd like to know if there's an example of using this library (not with LedMatrix)?

Seems the question is similar I decided to ask it here. I can create a separate issue if needed.

Jorgen-VikingGod commented 6 years ago

Hi @x43x61x69, sorry there is now example there without LedMatrix. Just try it out by your self. I'm currently really busy; so no time to make some. But if you have a simple example, just push it to here. Normally you only have to use instead of your CRGB array just the GFXcanvas, because it is based on the FastLED_GFX.

falconlmf commented 6 years ago

Hi Jorgen, Is it use with FastLED library? Would you mind to give few lines of initialization code?

Jorgen-VikingGod commented 6 years ago

just use GFXcanvas to initial the CRGB array. Than you can use all the methods from within the FastLED_GFX library. And afterwards just run FastLED.show() to display your pixels on your destination.

Jorgen-VikingGod commented 6 years ago

This lib is just a middleware to modify pixels. You still need to initial FastLED by LED type and color order etc... To do this, you can use the method getBuffer() from GFXcanvas to get the initialed CRGB array. And as I said, you also need to call show() for FastLED, to display the LEDs.

falconlmf commented 6 years ago

Thanks for your reply! CRGB* const leds( leds_plus_safety_pixel + 1); GFXcanvas haha(32, 8);

FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds,NUM_LEDS).setCorrection(TypicalSMD5050); For this example, where should I pass the "leds" to your library?

Jorgen-VikingGod commented 6 years ago

FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>( haha.getBuffer(), (haha. height() * haha.width()) ).setCorrection(TypicalSMD5050);

As I said, after you create GXFcanvas it creates internal a CRGB* in which the library paints. And by method getBuffer() you get the pointer of the CRGB data.

You only have to pass it over to FastLED with addLeds and you are finish.

Jorgen-VikingGod commented 6 years ago

currently added a simple example to master: https://github.com/Jorgen-VikingGod/FastLED-GFX/blob/master/examples/canvas/canvas.ino

H3cker7 commented 6 years ago

Hey Jorgen, is it possible to use the FastLED-GFX library with an LED-Matrix where the LED's are layed out in zigzag? I wasn´t able to combine the LEDMatrix library with the FastLED-GFX library.

Jorgen-VikingGod commented 6 years ago

@Joachim-Hecker, my first Version of FastLED-GFX was compatible with my Matrix library - but later I based my LEDMatrix Lib on LEDMatrix of Aaron Liddiment and drop the FastLED-GFX support again - but still have some draw methods build into. Just take a look at the LEDMatrix lib, it is really powerful and working great on FastLED. Did a lot of projects with it. You can also use tiles or multiple of layouts to get one big layout. I used for example 8 LED panels with each 16x8 Pixel (ZigZag, 50x25 cm) to get a Big Panel of 16x64 Pixel (50x200 cm)

marcouderzo commented 5 years ago

Hello! I am using FastLED_GFX to make an LED Spectrum Analyzer. By now, i figured out how to draw a vertical line onto the matrix, but i would like to draw the line and have the line displaying multiple colors. For example,

canvas.drawFastVLine(someParameter1, someParameter2, SomeParameter3, CRGB::Green); with CRGB::Green being some other function or palette, like "Red_to_Blue".

Is it possible to use some FastLED functions like fill_gradient_RGB() and how should I do it?

Jorgen-VikingGod commented 5 years ago

hi @marcouderzo this can not be answered by a 'yes' because it depends on your matrix layout. the internal FastLED methods like fill_gradient_RGB() will work by modify the buffer in row. But if your virtual column in the matrix is going over multople strips and zig-zag; the methods can not be working, that easy. Maybe it would be great to have helper method in my matrix class to get memory access to f.e. a row or column. So it will remap the values etc. But for now, I have no time to implement such features. If you have the time feel free to contribute this feature by a merge request. The community will be happy - I'm sure!

Jorgen-VikingGod commented 5 years ago

sorry - I thought this question was in the LEDMatrix repository...

michaelfransen commented 3 years ago

@Joachim-Hecker, my first Version of FastLED-GFX was compatible with my Matrix library - but later I based my LEDMatrix Lib on LEDMatrix of Aaron Liddiment and drop the FastLED-GFX support again - but still have some draw methods build into. Just take a look at the LEDMatrix lib, it is really powerful and working great on FastLED. Did a lot of projects with it. You can also use tiles or multiple of layouts to get one big layout. I used for example 8 LED panels with each 16x8 Pixel (ZigZag, 50x25 cm) to get a Big Panel of 16x64 Pixel (50x200 cm)

Is it true you can't do text with LEDMatrix though?