I am trying to light up a Tic-Tac-Toe grid on my 8x8 LED Matrix. I am using for loops for this task and only one (the first) LED lights up.
My code for lighting up one line of the grid:
/// FastLED - Version: 3.4.0
#include <FastLED.h>
#define NUM_LEDS 64
#define LED_PIN 7
CRGB leds[64];
const PROGMEM int LED_Matrix[8][8] =
{
{0,1,2,3,4,5,6,7},
{15,14,13,12,11,10,9,8},
{16,17,18,19,20,21,22,23},
{31,30,29,28,27,26,25,24},
{32,33,34,35,36,37,38,39},
{47,46,45,44,43,42,41,40},
{48,49,50,51,52,53,54,55},
{63,62,61,60,59,58,56,54}
};
void setup() {
FastLED.addLeds<WS2812B, LED_PIN, GRB>(leds, NUM_LEDS);
FastLED.setBrightness(25);
Serial.begin(9600);
FastLED.clear();
for(int i = 0; i<=7;i++){
leds[LED_Matrix[i][2]] = CRGB::White;
FastLED.show();
delay(1000);
}
}
void loop() {
}
Please help me
Thank You