Hi gang,
I'm new to Arduinoland and am truly enjoying it.
I have a digital RGB LED string of 19 36mm modules that only show red. When blue or green should be lit, they stay off. My wife (and cat!) are enjoying the chasing of the string but it would be far better if all the colors could play together.
I'm using an edited portion of Adafruit's Stringtest to run them
( I ran the whole code but the pauses between colors were disruptive...)
#include "SPI.h"
#include "Adafruit_WS2801.h"
/*****************************************************************************
Example sketch for driving Adafruit WS2801 pixels!
Designed specifically to work with the Adafruit RGB Pixels!
12mm Bullet shape ----> https://www.adafruit.com/products/322
12mm Flat shape ----> https://www.adafruit.com/products/738
36mm Square shape ----> https://www.adafruit.com/products/683
These pixels use SPI to transmit the color data, and have built in
high speed PWM drivers for 24 bit color per pixel
2 pins are required to interface
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
Written by Limor Fried/Ladyada for Adafruit Industries.
BSD license, all text above must be included in any redistribution
*****************************************************************************/
// Choose which 2 pins you will use for output.
// Can be any valid output pins.
// The colors of the wires may be totally different so
// BE SURE TO CHECK YOUR PIXELS TO SEE WHICH WIRES TO USE!
uint8_t dataPin = 2; // Yellow wire on Adafruit Pixels
uint8_t clockPin = 3; // Green wire on Adafruit Pixels
// Don't forget to connect the ground wire to Arduino ground,
// and the +5V wire to a +5V supply
// Set the first variable to the NUMBER of pixels. 25 = 25 pixels in a row
Adafruit_WS2801 strip = Adafruit_WS2801(19, dataPin, clockPin, WS2801_GRB);
// Optional: leave off pin numbers to use hardware SPI
// (pinout is then specific to each board and can't be changed)
//Adafruit_WS2801 strip = Adafruit_WS2801(25);
// For 36mm LED pixels: these pixels internally represent color in a
// different format. Either of the above constructors can accept an
// optional extra parameter: WS2801_RGB is 'conventional' RGB order
// WS2801_GRB is the GRB order required by the 36mm pixels. Other
// than this parameter, your code does not need to do anything different;
// the library will handle the format change. Examples:
//Adafruit_WS2801 strip = Adafruit_WS2801(25, dataPin, clockPin, WS2801_GRB);
//Adafruit_WS2801 strip = Adafruit_WS2801(25, WS2801_GRB);
void setup() {
strip.begin();
// Update LED contents, to start they are all 'off'
strip.show();
}
void loop() {
// Some example procedures showing how to display to the pixels
colorWipe(Color(0, 255, 0), 50);
colorWipe(Color(0, 0, 255), 500); //red
}
// fill the dots one after the other with said color
// good for testing purposes
void colorWipe(uint32_t c, uint8_t wait) {
int i;
for (i=0; i < strip.numPixels(); i++) {
strip.setPixelColor(i, c);
strip.show();
delay(wait);
}
}
/* Helper functions */
// Create a 24 bit color value from R,G,B
uint32_t Color(byte r, byte g, byte b)
{
uint32_t c;
c = r;
c <<= 8;
c |= g;
c <<= 8;
c |= b;
return c;
}
I've tried variations on the data and clock pins; default, new pair, and SPI. None have made any difference.
I have tried 3 separate 5 volt power supplies (1A, 2A, 3.5A) to make sure the LEDs weren't starving. No difference.
The wires are 16ga from the PS to the LEDs, more than adequate.
I have no idea who made the string. It was given to me after being used in an art project at Burning Man.
I am doubting that the modules are all bad, that they'd lose the two exact colors on every module. I'm thinking it's something I've done or not done...
Has anyone ever seen this behavior?