Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example #1

Open
sulram opened this issue Aug 24, 2017 · 15 comments
Open

Example #1

sulram opened this issue Aug 24, 2017 · 15 comments
Labels

Comments

@sulram
Copy link

sulram commented Aug 24, 2017

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

@Jorgen-VikingGod
Copy link
Owner

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
Copy link

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
Copy link
Owner

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
Copy link

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

@Jorgen-VikingGod
Copy link
Owner

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
Copy link
Owner

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
Copy link

falconlmf commented Mar 21, 2018

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
Copy link
Owner

Jorgen-VikingGod commented Mar 21, 2018

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
Copy link
Owner

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

@H3cker7
Copy link

H3cker7 commented Mar 29, 2018

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
Copy link
Owner

@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
Copy link

marcouderzo commented May 20, 2019

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
Copy link
Owner

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
Copy link
Owner

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

@michaelfransen
Copy link

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants