Hey everyone, so I have an old WS2812B 5V LED strip I am wiring up to an ATMEGA328 Arduino Nano. It has three wires: red (5V), green (DATA), and white (GND) I connected to 5V, D2, and GND on the Nano respectively. Here is the program I uploaded:
#include <FastLED.h>
#define LED_PIN 2
#define NUM_LEDS 6
CRGB leds[NUM_LEDS];
void setup() {
FastLED.addLeds<WS2812B, LED_PIN, GRB>(leds, NUM_LEDS);
}
void loop() {
leds[0] = CRGB::Red;
FastLED.show();
delay(1000);
}
For some reason the LED wasn't turning on, messed around a bit and pulled out the ground wire so only 5V and D2 were going to the LED strip. This fixed the problem and I'm wondering how this is possible without ground connected? Anyone know?
The Arduino is powered by 12V through Vin.
17 posts - 6 participants