-
Notifications
You must be signed in to change notification settings - Fork 20
1.Setting Up
NOTE This class uses the LEDMatrix class which must be downloaded separately from my GitHub.
In order to use the class you must have the following header files included in your program:-
#include <FastLED.h>
#include <LEDMatrix.h>
#include <LEDSprites.h>
You must declare an instance of the cLEDMatrix class as this is used to declare and modify the LED data according to the matrix dimensions, layout and origin.
cLEDMatrix<64, 8, HORIZONTAL_ZIGZAG_MATRIX> leds;
The LED array is allocated in the matrix class but the address of the array can be obtained by using '[0]' after the matrix variable name and '.Size()' to obtain the number of LED's:-
FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds[0], leds.Size());
Then you can declare the cLEDSprites class variable:-
cLEDSprites Sprites(&leds);
This is the main control class for the Sprites so only one of these is required in your program.
A second cSprite class is used to define each sprite that you want to use. These can then be registered with the cLEDSprites
class which will act as the controller for diaplaying/updating all the sprites.
cSprite Shape(SHAPE_WIDTH, SHAPE_HEIGHT, ShapeData, 1, _1BIT, ColTable, ShapeData);