|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools |
Rating:
|
Display Modes |
|
|
|
#1
|
||||
|
||||
|
Programming Led Light Strips
We are testing out the Andymark 8.2 ft RGB Led strip this year -> http://www.andymark.com/product-p/am-2645.htm, and are having some difficulty getting the leds to light up. We currently have the leds wired exactly as they are in the diagram located on the website. We have been testing with the example code on github, as well as some of our own code.
Code:
//This is simple "light saber" demo to show off the AM-2640 5V, Addressable LED strips http://www.andymark.com/product-p/am-2640.htm
//We ran this demo off of our AM-2287 ethernet arduino's http://www.andymark.com/product-p/am-2287.htm
//DO NOT try to power the whole strip off the arduino 5v regulator!
//At full bright white, the strip was drawing 1.5Amps or so. This will overheat the regulator.
//We recommend running these led strips off of the AM-0899 10-30Vin to 5V 5A out stepdown converter http://www.andymark.com/product-p/am-0899.htm
//If you want to get creative you could integrate this sound file to take this project to the next level http://www.mediacollege.com/downloads/sound-effects/star-wars/lightsaber/lightsaber_02.mp3
//Craig Kessler
//AndyMark , Inc. 12/04/2013
//https://code.google.com/p/fastspi/
//https://code.google.com/p/fastspi/wiki/CRGBreference
#include "FastSPI_LED2.h"
// How many leds are in the strip?
// The AM-2640 LED lightstrip is 2.5m long and has 80 leds.
// That is probably too long for a lightsaber but the strips can be cut to length at the junctions marked on the strip
// For easy wiring of cut strips use the AM-2641 clip on connector
#define NUM_LEDS 80
//Remember on the AM-2640 LED strip's yellow wire is ground! (don't blame us they come that way)
// Data pin that led data will be written out over
#define DATA_PIN 11 //Green wire from AM-2640's power connector
// Clock pin for SPI
#define CLOCK_PIN 13 //Blue wire from AM-2640's power connector
// This is an array of leds. One item for each led in your strip.
CRGB leds[NUM_LEDS];
// This function sets up the leds and tells the controller about them
void setup()
{
// 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<UCS1903, DATA_PIN, RGB>(leds, NUM_LEDS);
//This is the chipset in the AM-2640 LED strip
//FastLED.addLeds<WS2801, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<SM16716, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<LPD8806, RGB>(leds, NUM_LEDS);
FastLED.addLeds<WS2801, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS); // Slightly modified here to use data and clock pins
// FastLED.addLeds<SM16716, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<LPD8806, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
//Change the color value for the lightsaber color of your choice.
//The last number controls how long the saber takes to complete the lighting sequence.
light_saber_on(CRGB::Green, 35);
}
// This function runs over and over, and is where you do the magic to light
// your leds.
void loop()
{
//Nothing to do here. lightsaber function call is done once in setup()
}
void light_saber_on(uint32_t c, uint8_t wait)
{
int led_number = 0;
FastLED.clear();
FastLED.setBrightness(5);
for(led_number = 0; led_number < NUM_LEDS; led_number++)
{
delay(wait);
leds[led_number] = c;
FastLED.show();
//FastLED.show_one(led_number, led_brightness);
}
//Increase "beam" intensity with "power flicker"
for (int led_brightness = 5; led_brightness <= 100; led_brightness+=5 )
{
FastLED.setBrightness(led_brightness);
FastLED.show();
delay(40);
}
for (int led_brightness = 100; led_brightness >= 50; led_brightness-=5 )
{
FastLED.setBrightness(led_brightness);
FastLED.show();
delay(30);
}
for (int led_brightness = 50; led_brightness <= 100; led_brightness+=5 )
{
FastLED.setBrightness(led_brightness);
FastLED.show();
delay(25);
}
return;
}
|
|
#2
|
||||
|
||||
|
Re: Programming Led Light Strips
Describe what happens when you run the code.
Where do you see lights? Add print statements to your code, is it running properly? Check for proper voltages on the LED strip, and at the arduino, with a multimeter. If you're using the compression nut things shown on the AM page, maybe you are crimpped down on the wire jacket somewhere and not on the wire conductor. Provide photos of your setup. It's hard to debug a problem we can't see. Provide more information and people will be better able to help you. |
|
#3
|
||||
|
||||
|
Re: Programming Led Light Strips
When you click on the "Verify" button on the Arduino environment, does the process generate any errors?
As Otherguy asked, detailed photos of all connections to the Arduino, LED strip, and power supply will go a long way to helping us help you. |
|
#4
|
||||
|
||||
|
Re: Programming Led Light Strips
Thanks for the response, and sorry for the lack of detail, i will be able to get photos at our meeting tonight, i will check out the wire jackets when i get there as well, and also get the most recent version of code that we will run. as of now, none of our leds light up, but...
The arduino power light is lit. We have tested with a multimeter, and the led strip is getting power the code is running, and we have added print statements, the code i posted above does not have those however, one of our other programmers currently has that program The print statements do actually print. I will also double check the wiring... thanks again |
|
#5
|
||||
|
||||
|
Re: Programming Led Light Strips
Not meaning to tell stories on my self, but.......
I find that a high percentage of problems I have had using an Arduino are caused by not getting the connections to the right pin. That is equally true when using a breadboard. One pin off, and the project doesn't work. In your case, if the Printf statements work, then the code is reaching those lines. It may be as simple as having the Clock and/or Data wires in the wrong place. |
|
#6
|
|||
|
|||
|
Re: Programming Led Light Strips
#define DATA_PIN 11 //Green wire from AM-2640's power connector
#define CLOCK_PIN 13 //Blue wire from AM-2640's power connector Check these; it might define the name with the number plus the comment. So CLOCK_PIN gets replaced with "13 //Blue wire from AM-2640's power connector". Do a printf of CLOCK_PIN to check. Edit: Hmm, the #define on the arduino website seems to allow it, just don't use the end semicolon. Last edited by Roger : 17-01-2014 at 18:23. Reason: because I can |
|
#8
|
||||
|
||||
|
Re: Programming Led Light Strips
Quote:
It's simple things like this, or poorly documented functions, that always seem to cause the biggest problems. |
|
#9
|
||||
|
||||
|
Re: Programming Led Light Strips
I recently received at 5m lpd8806 digital LED strip, and have been having a problem with the entire strip lighting. The wires are all soldered and connected properly, as the majority of the strip is responding perfectly. The last 0.5 meter however, does not light at all. Originally it the entire strip functioned normally when I ran the strandtest example in Arduino IDE. I am only using a 2A power supply, could this be the issue? From what I read in the adafruit tutorial it seems that if the strip was not powered fully, the ending LEDs would still light up albeit not the correct colors.
|
|
#10
|
|||
|
|||
|
Re: Programming Led Light Strips
Did you change the code? Specifically the number of pixels defined. (Adafruit code I think keeps a standard #define at the top of the code.) Or change a loop to turn LEDs on/off?
Check the LED strip at the point between lit and unlit. Anything broken, bent? The last 0.5 meter point is on a joint. What is your power source? I don't run the LEDs thru the Arduino, but instead a separate 5V power source. I've had a 5 meter strip run for a couple hours on 4 x AA batteries, reducing to just the red pixels when the batteries run down. Usually, an all-white strip may dim at the end, but not totally turn off, but I haven't had much experience in that happening. There's usually something at the end. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|