View Single Post
  #1   Spotlight this post!  
Unread 17-03-2007, 08:09
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,847
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: Autonomous Switching

Quote:
Originally Posted by ManicMechanic View Post
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?
Just to avoid confusing people who are reading this be aware that the example I showed was for programming through MPLAB rather than EasyC. You can do the same thing in EasyC it's just a little different.

You can safely change the default configurations of inputs 1 & 2 to use those for jumpers.
With MPLAB You have to change: Set_Number_of_Analog_Channels(NO_ANALOGS);
The only issue that might change your mind is if you wanted to use an input for an analog sensor rather than digital. The way the Vex controller is designed any analog inputs you use are declared in order before your digital inputs.

If you use MPLAB to program your robot then rc_dig_in01 is defined.
In EasyC you'd drag in "Digital Inputs" from under "Inputs" to check your jumper.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote