Capacitor for digital RGB LED pixel strand

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Capacitor for digital RGB LED pixel strand

Postby rweaver » Thu Apr 28, 2011 7:02 pm

The excellent tutorial for these pixel strands (http://www.ladyada.net/products/rgbledpixel/) recommends:

As shown below, connect ground to both your supply and logic microcontroller. Then connect the 5V pin to the power supply. A large capacitor (1000uF or so) is a nice addition to keep ripple down.

Forgive my ignorance, but I'm not sure where to put said capacitor. Is it series between the 5V power supply output and the the strand's power input wire (the red wire)?

P.S.: I think there are two small bugs in the library for the pixels that's posted here: https://github.com/adafruit/LPD6803-RGB-Pixels. Specifically, both the 4-argument version of) setPixelColor in LPD6803.cpp, and the Color function in strandtest.pde, seem to place the r, g, and b arguments in the wrong order. i.e. r should be the 5 highest-order bits, then g, then b. (1) How best to alert the authorities? Does this suffice? (2) I may of course be wrong, but when I use the code as is I don't get the colors I expect, and when I modify it I do. So if I'm wrong can you explain what's going on?
rweaver
 
Posts: 10
Joined: Thu Mar 03, 2011 2:23 pm

Re: Capacitor for digital RGB LED pixel strand

Postby adafruit » Thu Apr 28, 2011 8:22 pm

what specific part number are the strands?

place the capacitor so minus is ground and plus is 5v
User avatar
adafruit
 
Posts: 10546
Joined: Thu Apr 06, 2006 3:21 pm
Location: nyc

Re: Capacitor for digital RGB LED pixel strand

Postby rweaver » Thu Apr 28, 2011 9:40 pm

rweaver
 
Posts: 10
Joined: Thu Mar 03, 2011 2:23 pm


Re: Capacitor for digital RGB LED pixel strand

Postby craiglindley » Mon Jul 11, 2011 10:38 am

I'm seeing the color problem as well with my project. I have 64 of the LED pixels connected together and driven by an Arduino Uno using your library and while stable, the color sequence is out of order. When I call the

strip.setPixelColor(i, r, g, b);

function if I set only the r(ed) component, the LED's display blue. If I set the g(reen) component, the LED's display red and when I only set the b(blue) component the LED's display green. No big deal because it is easy to fix.

I think the LEDs that I bought are hooked up differently internally than the ones originally used to create and test the library.

Craig Lindley
craiglindley
 
Posts: 6
Joined: Wed Jul 06, 2011 11:39 am


Re: Capacitor for digital RGB LED pixel strand

Postby craiglindley » Mon Jul 11, 2011 2:31 pm

Yes I did about two weeks ago
craiglindley
 
Posts: 6
Joined: Wed Jul 06, 2011 11:39 am

Re: Capacitor for digital RGB LED pixel strand

Postby adafruit » Mon Jul 11, 2011 9:18 pm

sounds like the company may have changed the wiring in a recent version :/ maybe just make a helper function to swap em?
User avatar
adafruit
 
Posts: 10546
Joined: Thu Apr 06, 2006 3:21 pm
Location: nyc

Re: Capacitor for digital RGB LED pixel strand

Postby craiglindley » Mon Jul 11, 2011 10:27 pm

Actually I changed the following two functions dealing with color and now everything works correctly.

// Create a 15 bit color value from R,G,B
unsigned int Color(byte r, byte g, byte b)
{
//Take the lowest 5 bits of each value and append them end to end
return( ((unsigned int)r & 0x1F )<<10 | ((unsigned int)g & 0x1F)<<5 | (unsigned int)b & 0x1F);
}

and

void LPD6803::setPixelColor(uint16_t n, uint8_t r, uint8_t g, uint8_t b) {
uint16_t data;

if (n > numLEDs) return;

data = r & 0x1F;
data <<= 5;
data |= g & 0x1F;
data <<= 5;
data |= b & 0x1F;
data |= 0x8000;
pixels[n] = data;
}

now the 16 bit color is formatted as follows:

1RRRRRGGGGGBBBBB

which makes more sense than the original arrangement.

Craig Lindley
craiglindley
 
Posts: 6
Joined: Wed Jul 06, 2011 11:39 am


Return to Glowy things (LCD, LED, TFT, EL) purchased at Adafruit

Who is online

Users browsing this forum: wolfgr and 4 guests

Stuff to buy from the Adafruit store and links to product documentation!


New Products [114]

Raspberry Pi[82]
 
FLORA[24]
 
Bunnie Studios[9]
 
FPGA[1]
 
mbed[12]
Arduino[60]
 
NETduino[14]
 
BeagleBone[23]
 
Android[6]
 
XBee[10]
More Dev Boards[30]


 
BoArduino[8]
 
SpokePOV[4]
 
TV-B-Gone[4]
 
MiniPOV[3]
 
SIM reader[3]
 
Microtouch[5]
 
Clocks & Watches[18]
 
Drawdio[4]
 
Brain Machine[1]
 
Game of Life[2]
 
MintyBoost[2]
More DIY Kits[16]


 
MaKey MaKey[3]
 
Tweet-a-Watt[5]
 
Young Engineers[39]
 
Discover Electronics[2]
 
Snap Circuits[4]
 
littleBits[3]
 
Project packs[9]


 
Breakout Boards[35]
LCDs & Displays[49]
Components & Parts[70]
Batteries & Power[54]
EL Wire/Tape/Panel[52]
LEDs[112]
 
Wireless[16]
Cables[66]
 
Lasers[6]
Sensors/Parts[147]
 
Enclosures/Cases[11]
 
Solar[11]
 
RFID / NFC[13]
Prototyping[70]
 
iDevices[13]
Tools[71]
 
Wearables[41]
 
CNC[37]
 
Robotics[29]
 
3D printing[1]
 
Materials[25]


 
Stickers[41]
 
Skill badges[55]
 
Books[26]
 
Circuit Playground[7]
 
Gift Certificates[4]