View Single Post
  #2   Spotlight this post!  
Unread 20-02-2007, 12:14
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
Re: multiple autonomous modes using easyc

You would need to wire the switch(s) to the joystick inputs on the OI. The OI uses standard analog PC game ports so you should be able to find what pin to connect to.

Once you have the switch connected you would read to value from it the same way you would read the joystick switches.

In autonomous you would just need an if-else if for each switch.
This code assumes you have switches wired to OI port 3 Trigger and Thumb/Top.
Code:
if(GetOIDInput(3,1))
{
  //first autonomous mode
}
else if(GetOIDInput(3,2)
{
  //second autonomous mode
}
....
If you are short on input, or need more than eight autonomous modes you could convert the switches to a binary number so you could get 4 options out of 2 switches or 16 from 4.
__________________
Eric Haskins KC9JVH

Last edited by EHaskins : 20-02-2007 at 12:15. Reason: typo