Go to Post No, we will not call you a "stupid freshman", we attribute your hasty remark due to lack of expirence, but you will gain that in time. - Mr. Ivey [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 28-02-2014, 16:30
Laxkief9098 Laxkief9098 is offline
Registered User
FRC #4557
 
Join Date: Jan 2014
Location: Connecticut
Posts: 17
Laxkief9098 is an unknown quantity at this point
AndyMark Example code not working

We just purchased an LED package with from andymark with a part number of am-2645. We have tried downloading the code to the contoler provided in the package which we have gotten off of github. When we try to download the code we receive the following errors:
sketch_feb28a:9: error: stray '#' in program
sketch_feb28a:13: error: stray '#' in program
sketch_feb28a:18: error: stray '#' in program
sketch_feb28a:21: error: stray '#' in program
sketch_feb28a:1: error: expected unqualified-id before '+' token
sketch_feb28a:25: error: expected unqualified-id before '+' token
sketch_feb28a:49: error: expected unqualified-id before '+' token
sketch_feb28a:68: error: expected unqualified-id before '+' token

Here is the code itself:
@@ -0,0 +1,113 @@
+ //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 "FastSPI_LED2.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);
+
+ 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);
+ // 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);
+ }
+ }
+ }
  #2   Spotlight this post!  
Unread 28-02-2014, 17:25
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: AndyMark Example code not working

Are those plus signs actually part of what you are trying to run? That looks like a diff instead of a source code file.
  #3   Spotlight this post!  
Unread 01-03-2014, 10:03
Laxkief9098 Laxkief9098 is offline
Registered User
FRC #4557
 
Join Date: Jan 2014
Location: Connecticut
Posts: 17
Laxkief9098 is an unknown quantity at this point
Re: AndyMark Example code not working

Yes when I copied the code from AndyMark's github the plus signs were included and are part of what I am trying to run. I thought that they were unnecessary so I deleted all of them and got a stray "#" error.

Last edited by Laxkief9098 : 01-03-2014 at 10:06.
  #4   Spotlight this post!  
Unread 02-03-2014, 03:20
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: AndyMark Example code not working

Quote:
Originally Posted by Laxkief9098 View Post
Yes when I copied the code from AndyMark's github the plus signs were included and are part of what I am trying to run. I thought that they were unnecessary so I deleted all of them and got a stray "#" error.
Did you also remove the tab character between the plus sign and the first actual character of the code? I'm pretty sure the #include directive has to begin at the very start of the line.

But I still think you copied the very first diff instead of the actual .ino file in the repository. Try getting the raw code from https://raw.github.com/AndyMark/Andy...er_Example.ino
  #5   Spotlight this post!  
Unread 07-03-2014, 11:40
Clifcecile's Avatar
Clifcecile Clifcecile is offline
Project liaison
FRC #4060 (Team SWAG)
Team Role: Mentor
 
Join Date: Nov 2011
Rookie Year: 2012
Location: W F West HS, Chehalis, WA
Posts: 11
Clifcecile is on a distinguished road
Re: AndyMark Example code not working

We compiled the "Light Chaser". We have the library installed and get not errors in compiling BUT the light strip just sits there with nothing happening. The last LED comes on and cycles through the colors if you shake it .

There is no loose wires and the wiring has be quadrupled checked.

We scoped the output from the arduino and getting great pulses.

Very frustrated. Have no idea what to do next.
  #6   Spotlight this post!  
Unread 12-03-2014, 22:53
Bradlye Gordon Bradlye Gordon is offline
Team Java Programmer
FRC #4485 (Tribe Tech)
Team Role: Programmer
 
Join Date: Oct 2013
Rookie Year: 2013
Location: Danville, IN
Posts: 4
Bradlye Gordon is an unknown quantity at this point
Re: AndyMark Example code not working

I am having that same problem, and also have no idea where to turn.
  #7   Spotlight this post!  
Unread 13-03-2014, 17:16
sparkytwd's Avatar
sparkytwd sparkytwd is offline
Registered User
FRC #3574
Team Role: Mentor
 
Join Date: Feb 2012
Rookie Year: 2012
Location: Seattle
Posts: 102
sparkytwd will become famous soon enough
Re: AndyMark Example code not working

Quote:
Originally Posted by Clifcecile View Post
We compiled the "Light Chaser". We have the library installed and get not errors in compiling BUT the light strip just sits there with nothing happening. The last LED comes on and cycles through the colors if you shake it .

There is no loose wires and the wiring has be quadrupled checked.

We scoped the output from the arduino and getting great pulses.

Very frustrated. Have no idea what to do next.
Do you have the ground connection between the power and arduino shared?
  #8   Spotlight this post!  
Unread 13-03-2014, 17:16
sparkytwd's Avatar
sparkytwd sparkytwd is offline
Registered User
FRC #3574
Team Role: Mentor
 
Join Date: Feb 2012
Rookie Year: 2012
Location: Seattle
Posts: 102
sparkytwd will become famous soon enough
Re: AndyMark Example code not working

Quote:
Originally Posted by Laxkief9098 View Post
Yes when I copied the code from AndyMark's github the plus signs were included and are part of what I am trying to run. I thought that they were unnecessary so I deleted all of them and got a stray "#" error.
You can go right to the raw output which will work better for this: https://raw.github.com/AndyMark/Andy...er_Example.ino
  #9   Spotlight this post!  
Unread 14-03-2014, 12:53
stefanp stefanp is offline
Registered User
AKA: Stefan Pleava
FRC #4946 (The Alpha Dogs)
Team Role: Alumni
 
Join Date: Oct 2013
Rookie Year: 2014
Location: Canada
Posts: 17
stefanp will become famous soon enough
Re: AndyMark Example code not working

Quote:
Originally Posted by Clifcecile View Post
We compiled the "Light Chaser". We have the library installed and get not errors in compiling BUT the light strip just sits there with nothing happening. The last LED comes on and cycles through the colors if you shake it .

There is no loose wires and the wiring has be quadrupled checked.

We scoped the output from the arduino and getting great pulses.

Very frustrated. Have no idea what to do next.
My team had just one led come on whenever the code wasn't working correctly. So make sure you are using working code. Check that you are compiling for the right type of ardunio. Make sure the pins are in the right places. Try pressing the reset button on the ardunio, it should change the brightness and color of one LED if it is not working. If it is it should restart the program.
  #10   Spotlight this post!  
Unread 19-03-2014, 12:41
thrashercharged thrashercharged is offline
Registered User
FRC #3940 (Cybertooth)
 
Join Date: Jan 2014
Rookie Year: 2009
Location: Kokomo IN
Posts: 8
thrashercharged is an unknown quantity at this point
Re: AndyMark Example code not working

I'm working with Craig @ AndyMark to write a beginner's guide for this product (since I'm a novice). Would you like a draft copy?

Tom
  #11   Spotlight this post!  
Unread 19-03-2014, 12:45
Ryan Dognaux's Avatar
Ryan Dognaux Ryan Dognaux is offline
Back Home in Indiana
FRC #4329 (Lutheran Roboteers)
Team Role: Mentor
 
Join Date: Apr 2002
Rookie Year: 2001
Location: Indianapolis, IN
Posts: 2,675
Ryan Dognaux has a reputation beyond reputeRyan Dognaux has a reputation beyond reputeRyan Dognaux has a reputation beyond reputeRyan Dognaux has a reputation beyond reputeRyan Dognaux has a reputation beyond reputeRyan Dognaux has a reputation beyond reputeRyan Dognaux has a reputation beyond reputeRyan Dognaux has a reputation beyond reputeRyan Dognaux has a reputation beyond reputeRyan Dognaux has a reputation beyond reputeRyan Dognaux has a reputation beyond repute
Send a message via AIM to Ryan Dognaux
Re: AndyMark Example code not working

Quote:
Originally Posted by thrashercharged View Post
I'm working with Craig @ AndyMark to write a beginner's guide for this product (since I'm a novice). Would you like a draft copy?

Tom
Can you post the draft version in this thread? Our team would greatly appreciate it as we are attempting to implement the light kit as well.
__________________
Ryan Dognaux :: Last Name Pronounced 'Doane Yo'
Team 234 Alum: 2002 - 2005 :: Purdue FIRST Member: 2006 - 2009
Team 1646 Mentor: 2007 - 2009 :: Team 357 Mentor: 2009 - 2012
Team 4329 Mentor: Current
STL Off-Season Event: www.gatewayroboticschallenge.com
  #12   Spotlight this post!  
Unread 20-03-2014, 01:26
thrashercharged thrashercharged is offline
Registered User
FRC #3940 (Cybertooth)
 
Join Date: Jan 2014
Rookie Year: 2009
Location: Kokomo IN
Posts: 8
thrashercharged is an unknown quantity at this point
Re: AndyMark Example code not working

Attached is my 1st draft. I tried to document all the problems I ran into. Luckily I had easy access to Craig's help.
Attached Files
File Type: pdf Beginners Guide AndyMark AM-2645 Rev1 .pdf (581.2 KB, 12 views)
  #13   Spotlight this post!  
Unread 24-03-2014, 15:32
thrashercharged thrashercharged is offline
Registered User
FRC #3940 (Cybertooth)
 
Join Date: Jan 2014
Rookie Year: 2009
Location: Kokomo IN
Posts: 8
thrashercharged is an unknown quantity at this point
Re: AndyMark Example code not working

Attached is Rev 1.2 with some minor edits and clarifications. Hope this helps someone out there.
Attached Files
File Type: pdf Beginners Guide AndyMark AM-2645 Rev1.2.pdf (585.5 KB, 17 views)
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:34.

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