View Single Post
  #15   Spotlight this post!  
Unread 31-03-2004, 10:09
DKolberg DKolberg is offline
Mentor Iron Giants
AKA: David Kolberg
FRC #5069 (Iron Giants)
Team Role: Mentor
 
Join Date: May 2002
Rookie Year: 2000
Location: South Bend
Posts: 44
DKolberg has a spectacular aura aboutDKolberg has a spectacular aura about
Re: Despite what IFI says, you can configure autonomous from OI...

We used the OI to program our autonomous mode and stored the mode in eeprom to ensure that it is available at all times. We only allow the mode to be changed while not in competition mode. We also used the leds on the OI to indicate the mode selected. We used the Switch LEDs to indicate 1 of 8 modes for autonomous and the Relay2 to indicate either left or right operation. This allowed quick verification / changes before the match began and could be programmed at any time prior to the match. Storing the mode in eeprom allows the mode to be maintained while power is off until the next time the mode is programmed.

if(compeition_mode !=0)
{
if (grabButton == 1 & freeButton == 1)
{
autonLR = autonMode & 0x8;
autonMode = ((armCmdInput-8) >> 5) & 0x7;
if (upButton == 1) {autonLR = 8;}
if (statButton == 1) {autonLR = 0;}
autonMode = autonMode + autonLR;
}
else
{
if (autonMode != autonEEP) //Update eeprom as necessary
{
writeEE (1,autonMode);
autonEEP = autonMode;
}
}
}

...

if(compeition_mode !=0)
{
Switch1_LED = (autonMode&0x4)>>2;
Switch2_LED = (autonMode&0x2)>>1;
Switch3_LED = (autonMode&0x1);
Relay2_green = (autonMode < 8);
Relay2_red = (autonMode > 7);
}


Dave
SBotz