So... I got a couple meters of this RGB LED strip from ebay (at 60 LEDs/meter, it's a total of 120 LEDs) and I can't seem to get it working.
I used the "FirstLight" example sketch from the FastLED.h library, made sure the strip's data was connected to the default pin 3, WS2811 was also the default so the only thing I had to change was the number of LEDs.
Also, after a few failures, I even added a blink toggle on pin 13 to indicate whenever it loops to make sure it isn't freezing up or anything (which worked fine), so now my code looks like this:
// Use if you want to force the software SPI subsystem to be used for some reason (generally, you don't)
// #define FORCE_SOFTWARE_SPI
// Use if you want to force non-accelerated pin access (hint: you really don't, it breaks lots of things)
// #define FORCE_SOFTWARE_SPI
// #define FORCE_SOFTWARE_PINS
#include "FastLED.h"
///////////////////////////////////////////////////////////////////////////////////////////
//
// Move a white dot along the strip of leds. This program simply shows how to configure the leds,
// and then how to turn a single pixel white and then off, moving down the line of pixels.
//
// How many leds are in the strip?
#define NUM_LEDS 120
// Data pin that led data will be written out over
#define DATA_PIN 3
// Clock pin only needed for SPI based chipsets when not using hardware SPI
//#define CLOCK_PIN 8
// This is an array of leds. One item for each led in your strip.
CRGB leds[NUM_LEDS];
boolean blinkState;
// This function sets up the ledsand tells the controller about them
void setup() {
// sanity check delay - allows reprogramming if accidently blowing power w/leds
delay(2000);
// Uncomment one of the following lines for your leds arrangement.
// FastLED.addLeds<TM1803, DATA_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<TM1804, DATA_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<TM1809, DATA_PIN, RGB>(leds, NUM_LEDS);
FastLED.addLeds<WS2811, DATA_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<WS2812, DATA_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<WS2812B, DATA_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
// FastLED.addLeds<WS2811_400, DATA_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<GW6205, DATA_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<GW6205_400, DATA_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<UCS1903, DATA_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<UCS1903B, DATA_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<WS2801, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<SM16716, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<LPD8806, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<P9813, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<WS2801, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<SM16716, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<LPD8806, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
pinMode(13, OUTPUT);
}
// This function runs over and over, and is where you do the magic to light
// your leds.
void loop() {
// Move a single white led
for(int whiteLed = 0; whiteLed < NUM_LEDS; whiteLed = whiteLed + 1) {
// Turn our current led on to white, then show the leds
leds[whiteLed] = CRGB::White;
// Show the leds (only one of which is set to white, from above)
FastLED.show();
// Wait a little bit
delay(100);
blinkState = !blinkState;
digitalWrite(13, blinkState);
// Turn our current led back to black for the next loop around
leds[whiteLed] = CRGB::Black;
}
}
I think the problem might lie with the power source, because when I tried to hook it up directly to Arduino's 5V pin, the Arduino's power and pin 13 LEDs only lit very dimly. I unplugged immediately so as not to cause damage, then through some research found that Arduino's 5V pin is rated at a max of 1 amp, whereas AA batteries typically put out about 2.4 amps. I also researched the draw for the LED strip, and at 1.2A/meter, AAs would be perfect (right? Or should it be more?). So I hooked up 3 AAs in series to get 4.5V at 2.4A, plugged the LED strip's VCC into the positive end, connected all the grounds (side note, can someone tell me why that's necessary? Anyway), and tried it out. The Arduino worked fine, but I still have yet to see any activity whatsoever from the LED strip, which is a bit concerning, because I'd expect them to at least light up dimly, or light up and then burn out or something, but this could even be a wiring problem which I've double and triple checked (although nothing is soldered yet because it was too hot yesterday so I suppose there's still a small chance, but the arrows are facing away from me and no wires are shorting that I know of and everything's in its place)...
Yep, I think that about sums it up... any ideas? Thanks in advance!