Hello,
I was recently gifted an Elegoo Mega2560 starter kit, and have an ambitious project in mind, but I am at this point unable to remember much from my EE microcontroller days spent over my HC11…
My final goal is to drive a set of LEDs under a sheet of lucite to make a map of sorts for a game board. I want to start simply by getting one to work, and then creating a different .ino file for each mission for each play of the game.
I ordered a set of WS2812B LEDs from Amazon, linked here:
Treedix WS2812B LEDs
After running through the lessons on the CD, I’ve found leaving the shallow end of the pool has a steep curve. Rather than posting a help me, I’ve tried to research the direction I want to go in. I’ve found this code from a tutorial (as well as posted here) as well as the FastLED website that has examples and command explanations.
#include <FastLED.h>
#define LED_PIN 7
#define NUM_LEDS 20
CRGB leds[NUM_LEDS];
void setup() {
FastLED.addLeds<WS2812, LED_PIN, GRB>(leds, NUM_LEDS);
}
void loop() {
leds[0] = CRGB(255, 0, 0);
FastLED.show();
delay(500);
leds[1] = CRGB(0, 255, 0);
FastLED.show();
delay(500);
leds[2] = CRGB(0, 0, 255);
FastLED.show();
delay(500);
leds[5] = CRGB(150, 0, 255);
FastLED.show();
delay(500);
leds[9] = CRGB(255, 200, 20);
FastLED.show();
delay(500);
leds[14] = CRGB(85, 60, 180);
FastLED.show();
delay(500);
leds[19] = CRGB(50, 255, 20);
FastLED.show();
delay(500);
}
My question is this: where would I find the information for setting up 8 individual rows of 7 LEDs in order to drive each output pin? The colors won’t be changing like I’ve seen in YouTube videos or on tutorials, and this code seems ok for a single row, but will get unwieldy for 8 rows. Does that make sense?
I don’t know what will be the most efficient way, but I intend on making as many mistakes as I can to figure out how not to do it.
Thank you in advance for any interest and/or helping me find my way.