View Single Post
  #14   Spotlight this post!  
Unread 12-02-2004, 16:31
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,793
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Beacon selector switch? How to find/make?

Quote:
Originally Posted by Code\\monkey
can you use the switches for other stuff? like if you want to change from IR autono to dead reck autono?, or if you have two dead reckonin codes, be able to switch it before the game?
If you can, can you tell me the variable asigned to the pins?
Thanks.
Yes, that's one of the main uses of switches.

We have:
- Left/Right switch
- Red/Blue alliance (the combinaton of these two specify the beacon type and which side of the robot the 10 pt ball will be on.)
- a 16-position BCD switch for selecting autonomous modes. It also doubles as a diagnostics switch when in user mode, e.g., center servos.

You can use a multi-position rotary switch from your local Radio Shack by wiring each position to a different available digital input.
Then test it in your code like so:
Code:
if (!rc_dig_in01)
{
	IR_Tracking();
}
else if (!rc_dig_in02)
{
	Dead_Reckon();
}
else
	Dead_Reckon();  // Always finish with a default setting
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle