I am new to Arduinos and I am trying to build an LED cloud, so I have bought two Arduinos, and two LED strips (1 is a WS2801B and 1 is an APA102C). Now, originally I planned on using the WS2801B but it it was giving me random patterns of color. Thinking maybe it was a faulty LED strip, I bought the APA102C with the clock pin.
Now I know I have it wired correctly (used multiple PWM pins with each of my programs, all give the same result). I originally had a complex code I was trying to work, however, after seeing that it was just giving me random patterns of colors and brightness, I decided to test it with pre-written example codes. I tried multiple libraries (FastLED as well as Dotstar) and everything gives me the same result.
The LEDs do not do what I want them to based on the code. I have random flashing of LEDs in no particular order and the colors are all haywire. When I have it programmed to react to input from my Android (through a 1Sheeld module), it does respond, just not the way I want it to. For example, if the code says "turn blue" when I press the "1" key, it will sometimes turn blue. Other times, it will turn purple, or red. I'm not particularly sure what's going on. Any help would be appreciated!
BTW, I have the strip connected to a 5V power supply, with the Arduino only providing the data and clock pins. The Arduino is powered through USB from my laptop.
For the curious, I took a video of what it's doing. For this video, the Arduino is running the following code:
#include "FastLED.h"
#define NUM_LEDS 150
#define DATA_PIN 12
#define CLOCK_PIN 11
uint8_t max_bright = 64;
CRGB leds[NUM_LEDS];
void setup() {
FastLED.addLeds<APA102, DATA_PIN, CLOCK_PIN, BGR>(leds, NUM_LEDS);
FastLED.setBrightness(max_bright);
}
void loop() {
for (int count = 0; count < NUM_LEDS; count++) {
leds[count] = CRGB::White;
FastLED.show();
delay(100);
leds[count] = CRGB::Black;
}
}