View Single Post
  #11   Spotlight this post!  
Unread 16-03-2007, 12:34
ManicMechanic ManicMechanic is offline
Registered User
AKA: Yolande
VRC #0438 (Metal Gear)
Team Role: Mentor
 
Join Date: Dec 2005
Rookie Year: 2003
Location: CA
Posts: 213
ManicMechanic has a reputation beyond reputeManicMechanic has a reputation beyond reputeManicMechanic has a reputation beyond reputeManicMechanic has a reputation beyond reputeManicMechanic has a reputation beyond reputeManicMechanic has a reputation beyond reputeManicMechanic has a reputation beyond reputeManicMechanic has a reputation beyond reputeManicMechanic has a reputation beyond reputeManicMechanic has a reputation beyond reputeManicMechanic has a reputation beyond repute
Re: Autonomous Switching

Sorry for the tedious n00bie questions -- I'm not a programmer.

From your code below, I'm assuming that you use the digital input from one of the 16 analog/digital ports to store in your variable. If we want to use Ports #1 & 2 (easiest to distinguish in a hurry), I'm assuming that we would have to reconfigure these as digital inputs. Are there any caveats/disadvantages to doing this, as opposed to using ports #11-16 (already configured as digital inputs by default)?

Does your variable rc_dig_in01 have to be declared anywhere prior using it to store the results of your digital input?

If we want to read a jumper in the interrupt ports instead, what command do we use to access the input from them?

Quote:
Originally Posted by Mark McLeod View Post
Sure. Even a simple jumper on any one of your digital inputs would work.
For example:
Code:
if (rc_dig_in01 == 1) // Can use a simple jumper to pick the autonomous to use
{
	 printf("This is Autonomous_1\r");
	 Autonomous_1();
}
else
{
	 printf("This is Autonomous_2\r");
	 Autonomous_2();
}
Finally, I'm still not seeing the advantage of switches over jumpers from this post. My mental picture of switches sees them as far more complicated than jumpers (attaching limit switches or bumpers and having to anchor them down). What am I missing?

Quote:
Originally Posted by James Brown
If you want more than 2 modes you can use multiple digital inputs (I like switches more than jumpers but they are essentially the same thing) 1 digital input gives you 2 possible modes, 2 inputs gives you 4, 3 gives you 8 etc.
Reply With Quote