Hello,
i have been trying to use 36 (6x6) WS2812 LEDs, connected in series, and running off of one digital pin, in order to create a connect 4 game. My plan was to implement buttons to move the counter (LED) around the board and store the location etc, in order to create a working game of connect 4, that could also be used as a music sequencer, however i have been struggling to get it off the ground and cannot figure out how to implement this idea, my fear is that because it is running off one digital pin, i will not be able to use a meaningful array in order to move the counter around etc.
If anyone has any guidance for me at all i would greatly appreciate it,
Thanks Again, Andrew
![]()
#include "FastLED.h"
#define NUM_LEDS 36
#define LED_PIN 3
int buttonPin = 8;
int buttonState = 0;
CRGB leds[NUM_LEDS];
void setup() {
// put your setup code here, to run once:
FastLED.addLeds<WS2812, LED_PIN, GRB>(leds, NUM_LEDS);
pinMode(buttonPin, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
buttonState = digitalRead(buttonPin);
if (buttonState == HIGH) {
leds[0] = CRGB(255,0,0);
FastLED.show();
}
else {
leds[0] = CRGB(0,0,0);
FastLED.show();
}
}