Go to Post People in FIRST ARE lucky, because they are living a very creative adventure which just doesn't let up, and that is okay. Who wants to sit there watching TV and being a spectator anyway. - DougHogg [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 Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 10-04-2013, 13:51
wre136's Avatar
wre136 wre136 is offline
Registered User
AKA: Will Edds
FRC #2461 (The METAL-SKINS)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2002
Location: Oklahoma City
Posts: 30
wre136 is an unknown quantity at this point
Make Robot Glow with Alliance Colors Automatically

If you are interested in making your robot glow the color of you alliance using LED lights, you can program it to choose a color automatically depending on which alliance you are on.

To start, add two relays to the robot. Wire one relay to control the red LEDs and the other relay to control the blue LEDs. Open the relays in the Begin VI and close them in the finish VI.

Create a new blank VI. Insert the "Get Alliance" VI from WPI Robotics Library -> Driver Station -> Get Alliance.VI

Place a Case structure in the block diagram and wire the Alliance Output terminal from the "Get Alliance" VI to the case selector icon.

Next add references for the two relays that control the LEDs to the VI. Wire them to Relay Set VIs. As for setting them, create a constant from one of the set VIs and move it into the Red case of the case structure and create a copy of it so there are two of these constants inside of the red case. Set one to on and the other to off. Wire the on constant to the Red Light Relay and the off to the Blue Light Relay.

Repeat the above for the blue case but make the appropriate switch for the values.

Lastly for the invalid case, wire an off to both terminals so that no lights will be on if no alliance is found.

Save the VI with a name you like. To use this VI, simply drag and drop it into a loop in periodical tasks and BOOM! There you go. Now even if you change your alliance using the driver station, your color should change with it. Enjoy ;-)
Attached Thumbnails
Click image for larger version

Name:	Alliance Color Code.PNG
Views:	167
Size:	7.7 KB
ID:	14565  
  #2   Spotlight this post!  
Unread 10-04-2013, 13:59
Banderoonies's Avatar
Banderoonies Banderoonies is offline
Team Mentor
AKA: Sandra
FRC #0195 (Cyber Knights)
Team Role: Leadership
 
Join Date: Sep 2008
Rookie Year: 2006
Location: Southington, CT
Posts: 216
Banderoonies is a glorious beacon of lightBanderoonies is a glorious beacon of lightBanderoonies is a glorious beacon of lightBanderoonies is a glorious beacon of lightBanderoonies is a glorious beacon of light
Re: Make Robot Glow with Alliance Colors Automatically

This would be so much cooler than changing bumpers.
__________________
Sandra
  #3   Spotlight this post!  
Unread 10-04-2013, 14:15
Jon Stratis's Avatar
Jon Stratis Jon Stratis is offline
Mentor, LRI, MN RPC
FRC #2177 (The Robettes)
Team Role: Mentor
 
Join Date: Feb 2007
Rookie Year: 2006
Location: Minnesota
Posts: 3,815
Jon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond repute
Re: Make Robot Glow with Alliance Colors Automatically

It's also possible to do this with a single Spike relay instead of two... Simply wire the LED's backwards of each other - for example, red gets its + wire to M+, and its - wire to M-, while blue gets its + wire to M-, and its - wire to M+. Put the spike in forward, one will light up. Put it in reverse and the other will light up. For the default/invalid state, turn it off.

This works because LED's are, above all else, a diode - they only conduct electricity (well, in an ideal world... in the real world there is some leakage) in one direction, and not the other. Thus, when powered "backwards", an LED won't light up!
__________________
2007 - Present: Mentor, 2177 The Robettes
LRI: North Star 2012-2016; Lake Superior 2013-2014; MN State Tournament 2013-2014, 2016; Galileo 2016; Iowa 2017
2015: North Star Regional Volunteer of the Year
2016: Lake Superior WFFA
  #4   Spotlight this post!  
Unread 10-04-2013, 14:16
Michael Hill's Avatar
Michael Hill Michael Hill is offline
Registered User
FRC #3138 (Innovators Robotics)
Team Role: Mentor
 
Join Date: Jul 2004
Rookie Year: 2003
Location: Dayton, OH
Posts: 1,580
Michael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond repute
Re: Make Robot Glow with Alliance Colors Automatically

Imagine a white light diffuser pool noodle cover with different colored LEDs behind them. That would be kinda cool. Not sure how team numbers would work. Maybe shadows on the inside of the diffuser.
  #5   Spotlight this post!  
Unread 10-04-2013, 15:08
wre136's Avatar
wre136 wre136 is offline
Registered User
AKA: Will Edds
FRC #2461 (The METAL-SKINS)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2002
Location: Oklahoma City
Posts: 30
wre136 is an unknown quantity at this point
Re: Make Robot Glow with Alliance Colors Automatically

I would think to white LEDs in the shape of the team number on the inside of the pool noodle would work, but is that legal? Cool if it was!
  #6   Spotlight this post!  
Unread 10-04-2013, 15:16
ekapalka's Avatar
ekapalka ekapalka is offline
Registered User
FRC #3216
 
Join Date: Dec 2012
Location: Bermuda
Posts: 277
ekapalka has a spectacular aura aboutekapalka has a spectacular aura about
Re: Make Robot Glow with Alliance Colors Automatically

Is there something like Get Alliance in C++ as well?
  #7   Spotlight this post!  
Unread 10-04-2013, 15:22
ykarkason ykarkason is offline
21st Century Schizoid Man
FRC #3316 (D-Bug)
Team Role: CAD
 
Join Date: Dec 2012
Rookie Year: 2013
Location: Israel
Posts: 63
ykarkason will become famous soon enoughykarkason will become famous soon enough
Re: Make Robot Glow with Alliance Colors Automatically

Yeah, there is, something like that:
Code:
DriverStation.GetInstance->GetAlliance()
Even though the syntax may be wrong, I'm a little rusty with C++...
  #8   Spotlight this post!  
Unread 10-04-2013, 15:22
Chris Hibner's Avatar Unsung FIRST Hero
Chris Hibner Chris Hibner is offline
Eschewing Obfuscation Since 1990
AKA: Lars Kamen's Roadie
FRC #0051 (Wings of Fire)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1997
Location: Canton, MI
Posts: 1,488
Chris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond repute
Re: Make Robot Glow with Alliance Colors Automatically

We did this on team 308 in 1999 (the first year of alliances). We had a 6" x 12" grid of LEDs on each side of the robot that we could switch from red to blue. That was the only year we did it, but it looked great.
__________________
-
An ounce of perception is worth a pound of obscure.
  #9   Spotlight this post!  
Unread 10-04-2013, 15:23
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,588
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Make Robot Glow with Alliance Colors Automatically

Quote:
Originally Posted by ekapalka View Post
Is there something like Get Alliance in C++ as well?
There is. In C++ see DriverStation::GetAlliance(). In Java it's DriverStation.getAlliance()
  #10   Spotlight this post!  
Unread 10-04-2013, 15:49
MikeE's Avatar
MikeE MikeE is offline
Wrecking nice beaches since 1990
no team (Volunteer)
Team Role: Engineer
 
Join Date: Nov 2008
Rookie Year: 2008
Location: New England -> Alaska
Posts: 381
MikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond repute
Re: Make Robot Glow with Alliance Colors Automatically

One of our students developed something similar this year with SPI bus driven tri-color LED strips running under Arduino control.
  • During the initial disabled period before the match the LED strips show a slowly chaning rainbow pattern
  • During autonomous the alliance color would flash along the LED strips
  • In teleop we would use each side as a bargraph to display the wheel encoder readings for each side of tank drive
  • On successful climb & dump the driver operates a switch and the LEDs show the team's "tie dye" colors in a flashing pattern
  • We had a few other modes programmed but didn't use them in matches
  • 4 DIO pins were used to communicate "mode" and 2 PWM to transmit "analog" values from the cRIO to the Arduino
Definitely the prettiest robot I've been associated with.
  #11   Spotlight this post!  
Unread 10-04-2013, 21:47
Michael Hill's Avatar
Michael Hill Michael Hill is offline
Registered User
FRC #3138 (Innovators Robotics)
Team Role: Mentor
 
Join Date: Jul 2004
Rookie Year: 2003
Location: Dayton, OH
Posts: 1,580
Michael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond repute
Re: Make Robot Glow with Alliance Colors Automatically

Quote:
Originally Posted by wre136 View Post
I would think to white LEDs in the shape of the team number on the inside of the pool noodle would work, but is that legal? Cool if it was!
Not currently (or any time in the foreseeable future), but one can hope!
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 22:38.

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