Go to Post Don't give FIRST ideas...we like our 45 day build season. They can make it shorter. Never underestimate the power of the GDC. - Littleboy [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rating: Thread Rating: 10 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 16-01-2014, 21:11
JML's Avatar
JML JML is offline
Jlyon
AKA: Jlyon
FRC #3044 (0xBe4)
Team Role: Programmer
 
Join Date: Oct 2012
Rookie Year: 2012
Location: 3044
Posts: 17
JML is an unknown quantity at this point
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;
}
Any help would be appreciated
  #2   Spotlight this post!  
Unread 17-01-2014, 11:20
otherguy's Avatar
otherguy otherguy is offline
sparkE
AKA: James
FRC #2168 (The Aluminum Falcons)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: CT
Posts: 430
otherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to behold
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.
__________________
http://team2168.org
  #3   Spotlight this post!  
Unread 17-01-2014, 11:44
billbo911's Avatar
billbo911 billbo911 is offline
I prefer you give a perfect effort.
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 2,356
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
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.
__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award.
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist
  #4   Spotlight this post!  
Unread 17-01-2014, 15:53
JML's Avatar
JML JML is offline
Jlyon
AKA: Jlyon
FRC #3044 (0xBe4)
Team Role: Programmer
 
Join Date: Oct 2012
Rookie Year: 2012
Location: 3044
Posts: 17
JML is an unknown quantity at this point
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   Spotlight this post!  
Unread 17-01-2014, 16:33
billbo911's Avatar
billbo911 billbo911 is offline
I prefer you give a perfect effort.
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 2,356
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
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.
__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award.
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist
  #6   Spotlight this post!  
Unread 17-01-2014, 18:08
Roger Roger is offline
Registered User
FRC #1153
 
Join Date: Jan 2006
Rookie Year: 1900
Location: Walpole MA
Posts: 685
Roger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond repute
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
  #7   Spotlight this post!  
Unread 19-01-2014, 18:20
evan1026's Avatar
evan1026 evan1026 is offline
Programmer extraordinaire ... ish
AKA: Evan Allan
no team
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2012
Location: USA
Posts: 6
evan1026 is on a distinguished road
Re: Programming Led Light Strips

I was also having issues with this strip. I documented the solution here. Take a look and see if it helps.
  #8   Spotlight this post!  
Unread 19-01-2014, 19:50
billbo911's Avatar
billbo911 billbo911 is offline
I prefer you give a perfect effort.
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 2,356
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
Re: Programming Led Light Strips

Quote:
Originally Posted by evan1026 View Post
I was also having issues with this strip. I documented the solution here. Take a look and see if it helps.
Nice catch!
It's simple things like this, or poorly documented functions, that always seem to cause the biggest problems.
__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award.
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist
  #9   Spotlight this post!  
Unread 08-03-2014, 01:17
matt79's Avatar
matt79 matt79 is offline
Registered User
None #0010
 
Join Date: Mar 2014
Location: Saint Cloud, MN
Posts: 1
matt79 is an unknown quantity at this point
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   Spotlight this post!  
Unread 08-03-2014, 10:37
Roger Roger is offline
Registered User
FRC #1153
 
Join Date: Jan 2006
Rookie Year: 1900
Location: Walpole MA
Posts: 685
Roger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond repute
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.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 03:02.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi