Go to Post This is a game of the mind. Size does not matter. - JohnBoucher [more]
Home
Go Back   Chief Delphi > Technical > Electrical
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 13-04-2013, 00:51
DjParaNoize-'s Avatar
DjParaNoize- DjParaNoize- is offline
Registered User
no team
Team Role: Leadership
 
Join Date: Mar 2013
Rookie Year: 2012
Location: California
Posts: 55
DjParaNoize- is an unknown quantity at this point
RGB LED Help

I've Got Some Addressable RGB LEDs (Strip) (WS2801)
I Need help hooking them up to my arduino I've tried example codes but they seem to have an error or don't work
  #2   Spotlight this post!  
Unread 13-04-2013, 00:52
mman1506's Avatar
mman1506 mman1506 is offline
Hater of Tiny Molex Connectors
AKA: Marcus Quintilian
no team (WARP7)
Team Role: Alumni
 
Join Date: Mar 2012
Rookie Year: 2012
Location: Toronto
Posts: 807
mman1506 has a reputation beyond reputemman1506 has a reputation beyond reputemman1506 has a reputation beyond reputemman1506 has a reputation beyond reputemman1506 has a reputation beyond reputemman1506 has a reputation beyond reputemman1506 has a reputation beyond reputemman1506 has a reputation beyond reputemman1506 has a reputation beyond reputemman1506 has a reputation beyond reputemman1506 has a reputation beyond repute
Re: RGB LED Help

What is the error?
__________________
2014-2015: FRC 865 Warp7 Team Captain
2016: FRC 865 Mentor

2017: Free Agent Mentor, Inspector
  #3   Spotlight this post!  
Unread 13-04-2013, 00:58
DjParaNoize-'s Avatar
DjParaNoize- DjParaNoize- is offline
Registered User
no team
Team Role: Leadership
 
Join Date: Mar 2013
Rookie Year: 2012
Location: California
Posts: 55
DjParaNoize- is an unknown quantity at this point
Re: RGB LED Help

Quote:
Originally Posted by mman1506 View Post
What is the error?
CODE:
// walking r-g-b
for (int j = 0; j < 3; j++) {
memset(leds, 0, NUM_LEDS * 3);
for(int i = 0; i < NUM_LEDS; i++ ) {
switch((i+j) % 3) {
case 0: leds[i].r = 200; break;
case 1: leds[i].g = 200; break;
case 2: leds[i].b = 200; break;
}
}
FastSPI_LED.show();
delay(300);

ERROR:
expected unqualified-id before 'for'


Please excuse me For I am Somewhat New to the coding
  #4   Spotlight this post!  
Unread 13-04-2013, 01:02
DjParaNoize-'s Avatar
DjParaNoize- DjParaNoize- is offline
Registered User
no team
Team Role: Leadership
 
Join Date: Mar 2013
Rookie Year: 2012
Location: California
Posts: 55
DjParaNoize- is an unknown quantity at this point
Re: RGB LED Help

Resource:
http://davidbu.ch/mann/blog/2011-09-...led-strip.html
  #5   Spotlight this post!  
Unread 13-04-2013, 01:04
ttldomination's Avatar
ttldomination ttldomination is offline
Sunny
no team
Team Role: Mentor
 
Join Date: Mar 2007
Rookie Year: 2007
Location: Roanoke, TX
Posts: 2,066
ttldomination has a reputation beyond reputettldomination has a reputation beyond reputettldomination has a reputation beyond reputettldomination has a reputation beyond reputettldomination has a reputation beyond reputettldomination has a reputation beyond reputettldomination has a reputation beyond reputettldomination has a reputation beyond reputettldomination has a reputation beyond reputettldomination has a reputation beyond reputettldomination has a reputation beyond repute
Re: RGB LED Help

Looks like an issue with function structure.

Is your code in main()?

Is your function header correct?

Additionally, it's often a good idea to google your errors. There's rarely an error that StackOverflow hasn't seen.

- Sunny G.
__________________
1261: 2007-2012
1648: 2013-2014
5283: 2015
  #6   Spotlight this post!  
Unread 13-04-2013, 01:13
DjParaNoize-'s Avatar
DjParaNoize- DjParaNoize- is offline
Registered User
no team
Team Role: Leadership
 
Join Date: Mar 2013
Rookie Year: 2012
Location: California
Posts: 55
DjParaNoize- is an unknown quantity at this point
Re: RGB LED Help

Quote:
Originally Posted by ttldomination View Post
Looks like an issue with function structure.

Is your code in main()?

Is your function header correct?

Additionally, it's often a good idea to google your errors. There's rarely an error that StackOverflow hasn't seen.

- Sunny G.
im honestly confused .
lets just start from the beginning and code this.
Ok What I want to do first is just power the LEDs
  #7   Spotlight this post!  
Unread 13-04-2013, 01:27
ttldomination's Avatar
ttldomination ttldomination is offline
Sunny
no team
Team Role: Mentor
 
Join Date: Mar 2007
Rookie Year: 2007
Location: Roanoke, TX
Posts: 2,066
ttldomination has a reputation beyond reputettldomination has a reputation beyond reputettldomination has a reputation beyond reputettldomination has a reputation beyond reputettldomination has a reputation beyond reputettldomination has a reputation beyond reputettldomination has a reputation beyond reputettldomination has a reputation beyond reputettldomination has a reputation beyond reputettldomination has a reputation beyond reputettldomination has a reputation beyond repute
Re: RGB LED Help

I personally do not know how to work with arduinos/LEDs, I suppose someone else could help you out there.

But seriously, Google.

- Sunny G.
__________________
1261: 2007-2012
1648: 2013-2014
5283: 2015
  #8   Spotlight this post!  
Unread 13-04-2013, 01:30
Pendulum^-1's Avatar
Pendulum^-1 Pendulum^-1 is offline
Mentor
AKA: Jim Grove
FRC #1915 (Firebird Robotics)
Team Role: Mentor
 
Join Date: Nov 2012
Rookie Year: 2007
Location: Maryland
Posts: 82
Pendulum^-1 is just really nicePendulum^-1 is just really nicePendulum^-1 is just really nicePendulum^-1 is just really nice
Re: RGB LED Help

I got a set of this light strip from adafruit. Tutorial was great.
http://learn.adafruit.com/digital-led-strip

Go to the menu on the left side of the page, read through the code, wiring, troubleshooting, etc.

Took me a bit of homework to get mine working, but it now works like a champ. I simply used their example code from their Arduino library (see the code page), and modified it to get the behavior I wanted.
__________________
Jim Grove, Mentor
firebirds1915.blogspot.com
(2007-2017) 1915, McKinley Tech HS, Washington, DC
(2009) 2932, Mid-Pac Institute, Honolulu, HI (Rookie Season)
(2011) 2425, Hillsborough HS, Tampa, FL
(2013-2015) 4464, College Park, MD, 2013 Rookie All Star Winner and 2014 Regional Champions, Washington, DC

FIRST is not rocket science. But it is like drinking from a fire hose.
  #9   Spotlight this post!  
Unread 13-04-2013, 01:40
DjParaNoize-'s Avatar
DjParaNoize- DjParaNoize- is offline
Registered User
no team
Team Role: Leadership
 
Join Date: Mar 2013
Rookie Year: 2012
Location: California
Posts: 55
DjParaNoize- is an unknown quantity at this point
Re: RGB LED Help

Quote:
Originally Posted by Pendulum^-1 View Post
I got a set of this light strip from adafruit. Tutorial was great.
http://learn.adafruit.com/digital-led-strip

Go to the menu on the left side of the page, read through the code, wiring, troubleshooting, etc.

Took me a bit of homework to get mine working, but it now works like a champ. I simply used their example code from their Arduino library (see the code page), and modified it to get the behavior I wanted.
currently reading this info
  #10   Spotlight this post!  
Unread 13-04-2013, 02:23
Roger Roger is offline
Registered User
FRC #1153
 
Join Date: Jan 2006
Rookie Year: 1900
Location: Walpole MA
Posts: 688
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: RGB LED Help

Adafruit's tutorials are the way to go.

If you haven't used an Arduino before, it's C, but they hide main(). You use setup() once to set up, then loop() for every loop. Make sure you download the LED libraries (Adafruit will point you the way) and put them in the Arduino \libraries. The LED library has examples of simple code to give you an idea how to light up.

Hardware tip: If you power the LEDs separate from the Arduino, make sure you run a ground wire between the two. Otherwise it'll be exciting lighting but not remotely what you want. (It won't ruin them, btw.)

Software tip: I forget the exact command, but if you're using Adafruit's library, if you don't do ".show" before the end of loop() the LEDs won't update.
  #11   Spotlight this post!  
Unread 13-04-2013, 03:02
DjParaNoize-'s Avatar
DjParaNoize- DjParaNoize- is offline
Registered User
no team
Team Role: Leadership
 
Join Date: Mar 2013
Rookie Year: 2012
Location: California
Posts: 55
DjParaNoize- is an unknown quantity at this point
Re: RGB LED Help

Thanks you guys got it working!
  #12   Spotlight this post!  
Unread 30-07-2013, 02:57
kathy82's Avatar
kathy82 kathy82 is offline
Junior Member
no team
 
Join Date: Jul 2013
Location: San Francisco, CA
Posts: 1
kathy82 is an unknown quantity at this point
Re: RGB LED Help

ToDo:
Download the Library from here(https://github.com/adafruit/Adafruit-WS2801-Library) to use this script!

Function:
Changes the color between /Black (off)/Red / Green / Blue /White) with a delay of 1 Second.

BTW, I got my ws2801 led pixels from http://www.lightingnext.com/12mm-ws2...ed-pixels.html
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 20: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