GOt power, loaded library, all but 1 LED works

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
djcaelum
 
Posts: 14
Joined: Tue May 23, 2017 1:40 pm

GOt power, loaded library, all but 1 LED works

Post by djcaelum »

Hello, first time LED user. I am attempting to wire my Ikea Expedit record shelving with addressable RBG strip. In the end I will have 16 LED strips with 9 LEDS per strip. I am currently testing on a smaller strip of 4 LEDs. My problem is that when i have the ground from the LED connected to arduino, the LED strip works as expected as it is changing colors. The problem is one of the LEDs is not lighting up. But when I unplug the ground from the strip, all LEDs light up, but the color changing effect stops. On an earlier test I had 5 LEDs and the same thing, the LED with the soldered connections is not working when the ground is attached. Here is a 2 photos, one with the ground disconnected and all LEDs lit, but not color changing, one with all LEDs lit, but are not color changing as expected.
Any help would be appreciated, I thought i fried the LED that wasn't lighting up at first, but when i cut off the individual LED and it then the newly soldered LED didn't, i feel i am overlooking something or doing something wrong. http://imgur.com/a/FicxS

I am using an arduino uno, and the "rainbow" example from the APA library
Last edited by djcaelum on Wed May 24, 2017 2:10 am, edited 1 time in total.

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: GOt power, loaded library, all but 1 LED works

Post by adafruit_support_mike »

You need to have GND connected at all times. That's the reference point from which all other voltages in the circuit are measured. Without it, the LED drivers don't know whether the wire connected to the Arduino is high or low. The LEDs take random colors when you disconnect GND because they see the noise from the wire being disconnected as a control signal.

The LEDs in the photo look like an LPD8806 strip. Post the code you're using and we'll see if that has any clues about why the first LED isn't doing anything.

User avatar
djcaelum
 
Posts: 14
Joined: Tue May 23, 2017 1:40 pm

Re: GOt power, loaded library, all but 1 LED works

Post by djcaelum »

Thank you so much, I will post when I get home from work in about an hour.

Much appreciated!

User avatar
djcaelum
 
Posts: 14
Joined: Tue May 23, 2017 1:40 pm

Re: GOt power, loaded library, all but 1 LED works

Post by djcaelum »

Here is the code, It may be the wrong kind of LED strip that I am using?
I thought as long as it it had 4 pins it would work, thanks for your help, noob here.

/* This example shows how to display a moving rainbow pattern on
* an APA102-based LED strip. */

/* By default, the APA102 library uses pinMode and digitalWrite
* to write to the LEDs, which works on all Arduino-compatible
* boards but might be slow. If you have a board supported by
* the FastGPIO library and want faster LED updates, then install
* the FastGPIO library and uncomment the next two lines: */
// #include <FastGPIO.h>
// #define APA102_USE_FAST_GPIO

#include <APA102.h>

// Define which pins to use.
const uint8_t dataPin = 11;
const uint8_t clockPin = 12;

// Create an object for writing to the LED strip.
APA102<dataPin, clockPin> ledStrip;

// Set the number of LEDs to control.
const uint16_t ledCount = 4;

// Create a buffer for holding the colors (3 bytes per color).
rgb_color colors[ledCount];

// Set the brightness to use (the maximum is 31).
const uint8_t brightness = 1;

void setup()
{
}

/* Converts a color from HSV to RGB.
* h is hue, as a number between 0 and 360.
* s is the saturation, as a number between 0 and 255.
* v is the value, as a number between 0 and 255. */
rgb_color hsvToRgb(uint16_t h, uint8_t s, uint8_t v)
{
uint8_t f = (h % 60) * 255 / 60;
uint8_t p = (255 - s) * (uint16_t)v / 255;
uint8_t q = (255 - f * (uint16_t)s / 255) * (uint16_t)v / 255;
uint8_t t = (255 - (255 - f) * (uint16_t)s / 255) * (uint16_t)v / 255;
uint8_t r = 0, g = 0, b = 0;
switch((h / 60) % 6){
case 0: r = v; g = t; b = p; break;
case 1: r = q; g = v; b = p; break;
case 2: r = p; g = v; b = t; break;
case 3: r = p; g = q; b = v; break;
case 4: r = t; g = p; b = v; break;
case 5: r = v; g = p; b = q; break;
}
return rgb_color(r, g, b);
}

void loop()
{
uint8_t time = millis() >> 4;

for(uint16_t i = 0; i < ledCount; i++)
{
uint8_t p = time - i * 8;
colors = hsvToRgb((uint32_t)p * 359 / 256, 255, 255);
}

ledStrip.write(colors, ledCount, brightness);

delay(10);
}

User avatar
djcaelum
 
Posts: 14
Joined: Tue May 23, 2017 1:40 pm

Re: GOt power, loaded library, all but 1 LED works

Post by djcaelum »

Thank you, i was able to find the LPD8806 Library. Thank you!

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: GOt power, loaded library, all but 1 LED works

Post by adafruit_support_mike »

Sorry for the late follow-up, but it looks like you found the problem. Happy hacking!

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”