Go to Post The part I like best is your method of transfering the torque via the balls. Very elegant. - Joe Johnson [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: 5 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 18-02-2014, 18:14
Maxwell777's Avatar
Maxwell777 Maxwell777 is offline
Is allowed to touch stuff now
AKA: Jackson Gray
FRC #0842 (Falcon Robotics)
Team Role: Programmer
 
Join Date: Aug 2013
Rookie Year: 2014
Location: Phoenix, AZ
Posts: 73
Maxwell777 has a spectacular aura aboutMaxwell777 has a spectacular aura aboutMaxwell777 has a spectacular aura about
Andymark LED strip Programming Issues

So, I'm moderatly new to programming with Arduinos. I'm trying to set up this LED strip, and I'm trying to run the light chaser example. I included all of the relevant libraries (I get the feeling that I didn't do it correctly, even though It seems to be), but I'm getting a few errors whenever I verify the code.

The Error(s):

LEDchaser.cpp.o: In function `missing_dot_chase(unsigned long, unsigned char)':
C:\Program Files (x86)\Arduino/LEDchaser.ino:97: undefined reference to `FastLED'
C:\Program Files (x86)\Arduino/LEDchaser.ino:97: undefined reference to `FastLED'
LEDchaser.cpp.o: In function `CFastLED::show()':
C:\Users\Maxwell\Google Drive\FRC_Programs\LED Strip\LEDchaser/FastLED.h:132: undefined reference to `CFastLED::show(unsigned char)'
LEDchaser.cpp.o: In function `color_chase(unsigned long, unsigned char)':
C:\Program Files (x86)\Arduino/LEDchaser.ino:71: undefined reference to `FastLED'
C:\Program Files (x86)\Arduino/LEDchaser.ino:71: undefined reference to `FastLED'
C:\Program Files (x86)\Arduino/LEDchaser.ino:71: undefined reference to `CFastLED::clear(unsigned char)'
LEDchaser.cpp.o: In function `CFastLED::show()':
C:\Users\Maxwell\Google Drive\FRC_Programs\LED Strip\LEDchaser/FastLED.h:132: undefined reference to `CFastLED::show(unsigned char)'
LEDchaser.cpp.o: In function `loop':
C:\Program Files (x86)\Arduino/LEDchaser.ino:59: undefined reference to `hsv2rgb_rainbow(CHSV const&, CRGB&)'
LEDchaser.cpp.o: In function `CLEDController* CFastLED::addLeds<(EClocklessChipsets)3, (unsigned char)11, (EOrder)10>(CRGB const*, int, int)':
C:\Users\Maxwell\Google Drive\FRC_Programs\LED Strip\LEDchaser/FastLED.h:115: undefined reference to `CFastLED::addLeds(CLEDController*, CRGB const*, int, int)'
LEDchaser.cpp.o: In function `setup':
C:\Program Files (x86)\Arduino/LEDchaser.ino:33: undefined reference to `FastLED'
C:\Program Files (x86)\Arduino/LEDchaser.ino:33: undefined reference to `FastLED'


The Code:
//This is a mashup of FastSPI_LED2 firstlight example and some other light chase hacks
//AndyMark, LLC
//Craig Kessler 12/3/2013
//Works with the AndyMark AM-2640 LED Strip based on the WS2801 chipset
//This code requires that the fastspi library be put in your arduino\libraries folder

//https://code.google.com/p/fastspi/
//https://code.google.com/p/fastspi/wiki/CRGBreference
#include "C:\Users\Maxwell\Google Drive\FRC_Programs\LED Strip\LEDchaser\FastLED.h"

// How many leds are in the strip? AndyMark's 2.5 meter strip has 80 leds
#define NUM_LEDS 80

//Remember on the AM-2640 LED strips yellow 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

// Clock pin only needed for SPI based chipsets
#define CLOCK_PIN 13 //Blue Wire

// 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() {
// sanity check delay - allows reprogramming if accidentally blowing power w/leds
delay(2000);

// 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);

//lastLED.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);
// FastLED.addLeds<SM16716, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<LPD8806, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
}

// This function runs over and over, and is where you do the magic to light
// your leds.
void loop()
{
//https://code.google.com/p/fastspi/wiki/CRGBreference
color_chase(CRGB::Green, 10);
color_chase(CRGB::BlueViolet, 10);
CRGB temp_rgb;
CHSV hsv(215,255,255);
hsv2rgb_rainbow(hsv, temp_rgb);
missing_dot_chase(CRGB::White, 25);
missing_dot_chase(CRGB::Red, 25);
missing_dot_chase(CRGB::Yellow, 25);
missing_dot_chase(CRGB::Green, 25);
missing_dot_chase(CRGB::Cyan, 25);
missing_dot_chase(CRGB::Blue, 25);
missing_dot_chase(0x3000cc, 25) ;
}

void color_chase(uint32_t color, uint8_t wait)
{
FastLED.clear();
FastLED.setBrightness(100);
// Move a single led
for(int led_number = 0; led_number < NUM_LEDS; led_number++)
{
// Turn our current led ON, then show the leds
leds[led_number] = color;

// Show the leds (only one of which is set to white, from above)
FastLED.show();

// Wait a little bit
delay(50);

// Turn our current led back to black for the next loop around
leds[led_number] = CRGB::Black;
}
}

//Move an "empty" dot down the strip
void missing_dot_chase(uint32_t color, uint8_t wait)
{
int led_number;

for (int led_brightness = 100; led_brightness > 10; led_brightness/=2)
{
FastLED.setBrightness(led_brightness);
// Start by turning all pixels on:
for(led_number = 0; led_number < NUM_LEDS; led_number++) leds[led_number] = color;

// Then display one pixel at a time:
for(led_number = 0; led_number < NUM_LEDS; led_number++)
{
leds[led_number] = CRGB::Black; // Set new pixel 'off'
if( led_number > 0 && led_number < NUM_LEDS)
{
leds[led_number-1] = color; // Set previous pixel 'on'
}
FastLED.show();
delay(wait);
}
}
}


I've been looking around, and I can't seem to much material on setting up this LED string, and coding for it.

If you need any more information, just say it

Help is always appreciated, whether it's for the error or general help programming the LEDs.

Last edited by Maxwell777 : 18-02-2014 at 18:31.
  #2   Spotlight this post!  
Unread 18-02-2014, 18:25
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,384
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: Andymark LED strip Programming Issues

Quote:
Originally Posted by Maxwell777 View Post
So, I'm moderatly new to programming with Arduinos. I'm trying to set up this LED strip, and I'm trying to run the light chaser example. I included all of the relevant libraries (I get the feeling that I didn't do it correctly, even though It seems to be), but I'm getting a few errors whenever I verify the code.

The Error(s):

LEDchaser.cpp.o: In function `missing_dot_chase(unsigned long, unsigned char)':
C:\Program Files (x86)\Arduino/LEDchaser.ino:97: undefined reference to `FastLED'
C:\Program Files (x86)\Arduino/LEDchaser.ino:97: undefined reference to `FastLED'
LEDchaser.cpp.o: In function `CFastLED::show()':
C:\Users\Maxwell\Google Drive\FRC_Programs\LED Strip\LEDchaser/FastLED.h:132: undefined reference to `CFastLED::show(unsigned char)'
LEDchaser.cpp.o: In function `color_chase(unsigned long, unsigned char)':
C:\Program Files (x86)\Arduino/LEDchaser.ino:71: undefined reference to `FastLED'
C:\Program Files (x86)\Arduino/LEDchaser.ino:71: undefined reference to `FastLED'
C:\Program Files (x86)\Arduino/LEDchaser.ino:71: undefined reference to `CFastLED::clear(unsigned char)'
LEDchaser.cpp.o: In function `CFastLED::show()':
C:\Users\Maxwell\Google Drive\FRC_Programs\LED Strip\LEDchaser/FastLED.h:132: undefined reference to `CFastLED::show(unsigned char)'
LEDchaser.cpp.o: In function `loop':
C:\Program Files (x86)\Arduino/LEDchaser.ino:59: undefined reference to `hsv2rgb_rainbow(CHSV const&, CRGB&)'
LEDchaser.cpp.o: In function `CLEDController* CFastLED::addLeds<(EClocklessChipsets)3, (unsigned char)11, (EOrder)10>(CRGB const*, int, int)':
C:\Users\Maxwell\Google Drive\FRC_Programs\LED Strip\LEDchaser/FastLED.h:115: undefined reference to `CFastLED::addLeds(CLEDController*, CRGB const*, int, int)'
LEDchaser.cpp.o: In function `setup':
C:\Program Files (x86)\Arduino/LEDchaser.ino:33: undefined reference to `FastLED'
C:\Program Files (x86)\Arduino/LEDchaser.ino:33: undefined reference to `FastLED'


I've been looking around, and I can't seem to much material on setting up this LED string, and coding for it.

If you need any more information, just say it

Help is always appreciated, whether it's for the error or general help programming the LEDs.
Could you either attach your code, or post it here. That will help 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
  #3   Spotlight this post!  
Unread 18-02-2014, 18:32
Maxwell777's Avatar
Maxwell777 Maxwell777 is offline
Is allowed to touch stuff now
AKA: Jackson Gray
FRC #0842 (Falcon Robotics)
Team Role: Programmer
 
Join Date: Aug 2013
Rookie Year: 2014
Location: Phoenix, AZ
Posts: 73
Maxwell777 has a spectacular aura aboutMaxwell777 has a spectacular aura aboutMaxwell777 has a spectacular aura about
Re: Andymark LED strip Programming Issues

Added Code
  #4   Spotlight this post!  
Unread 05-03-2014, 16:02
phineasjw's Avatar
phineasjw phineasjw is offline
Controls Development Engineer
no team
 
Join Date: Jan 2014
Rookie Year: 1712
Location: Kokomo
Posts: 3
phineasjw is an unknown quantity at this point
Re: Andymark LED strip Programming Issues

The errors all seem to stem from the FastLED library not being found.

Fortunately, with the latest release of the Arduino programming toolset (IDE) Arduino has made it easier to add software libraries. The procedure is described here.

After you get the library (get it here) installed the code should compile and run fine. You may need to restart the IDE to get it to acknowledge the new library. Be patient when compiling, the IDE is written in Java and is therefore quite slow.

Also, make sure you pay attention to the wiring info from here since the wire colors are not standard (i.e. yellow is ground). Make sure the LED strip ground is connected to the Arduino ground (Gnd) as this is the ground reference for the SPI communications. Finally, make sure that no more than 5V is applied to the LED strip's power pin or the driver ICs will fry.

If you are new to Arduino, a good place to start is here

Finally, whenever you have any issue with an AndyMark part please fee free to contact us directly via phone or email. We try to scan chiefdelphi for posts but we don't always catch them. Contacting us directly will get you a much more timely answer.

I hope this is not too late to be of help.
  #5   Spotlight this post!  
Unread 05-03-2014, 16:49
atsanders atsanders is offline
Registered User
FRC #0016
 
Join Date: Mar 2012
Location: Mountain Home, AR
Posts: 2
atsanders is an unknown quantity at this point
Re: Andymark LED strip Programming Issues

You can manually add the FastLED library to the arduino libraries by adding the FastLED code files to C:\Program Files (x86)\Arduino\libraries\FastLED. (C:\Program Files\Arduino\libraries\FastLED on 32 bit). I can't remember the library path on linux, but I can get it for you if you need it.

You can get the FastLED library from here: https://github.com/FastLED/FastLED. However, it seems like you already have it, so just move the code files the path listed above. You will need to create the FastLED folder inside libraries folder and paste all the code files directly into FastLED folder.

After that, you can change the include to #include "FastLED.h".

I was able to compile after doing those two things.
  #6   Spotlight this post!  
Unread 06-03-2014, 09:21
phineasjw's Avatar
phineasjw phineasjw is offline
Controls Development Engineer
no team
 
Join Date: Jan 2014
Rookie Year: 1712
Location: Kokomo
Posts: 3
phineasjw is an unknown quantity at this point
Re: Andymark LED strip Programming Issues

If you do a manual library add, don't put it in either of these
Quote:
C:\Program Files (x86)\Arduino\libraries\FastLED. (C:\Program Files\Arduino\libraries\FastLED on 32 bit)
It will work but the next time you upgrade the Arduino IDE everything you added will "disappear" (actually it gets left behind in the old programs folder).

Arduino now provides a user folder that allows you to preserve your libraries and other changes whenever you upgrade.

As excerpted from Arduino's Installing Additional Libraries instructions

Quote:
Under Windows, it will likely be called "My Documents\Arduino\libraries". For Mac users, it will likely be called "Documents/Arduino/libraries". On Linux, it will be the "libraries" folder in your sketchbook.
This is why I suggested to use the new built-in method. It works directly with your new library's zip file and puts it in the correct folder.
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 02:40.

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