Go to Post "One man's trash is our robotics team's fundraiser" (We have an aluminum can drive to raise money) - bombadier337 [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #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:	166
Size:	7.7 KB
ID:	14565  
 


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