Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <FastLED.h>
- #define C_PIN 4 // clock pin
- #define D_PIN 5 //data pin
- #define BRIGHTNESS 200 //brightness
- #define LED_T APA102 // LED Type
- #define COLOR_ORDER GBR
- #define NUM_LEDS 72 // number of LED's in my strip.
- CRGB leds[NUM_LEDS]; // name the strip
- void setup() {
- delay(1000) ; //power up safety delay
- FastLED.addLeds<LED_T,D_PIN,C_PIN, COLOR_ORDER>(leds, NUM_LEDS);
- FastLED.setBrightness(BRIGHTNESS);
- }
- //below is a 2D "grid" multidimensional array already Initialized with data.
- int TestGrid[5][4] = {
- (0,255,0),(0,0,255),(0,255,0),(0,255,0),
- (0,255,0),(0,0,255),(0,255,0),(0,255,0),
- (0,255,0),(255,0,255),(255,0,0),(0,255,0),
- (0,255,0),(0,0,255),(255,0,255),(0,255,0),
- (0,255,0),(0,255,0),(0,255,0),(0,255,0)
- };
- void loop() {
- leds[0] = CRGB(255,255,0);
- leds[1] = CRGB(TestGrid[0][1]);
- leds[2] = CRGB(TestGrid[1][2]);
- leds[3] = CRGB(TestGrid[2][1]);
- leds[4] = CRGB(TestGrid[5][2]);
- FastLED.show();
- }
Advertisement
Add Comment
Please, Sign In to add comment