View Single Post
  #2   Spotlight this post!  
Unread 16-03-2012, 10:16
DjScribbles DjScribbles is offline
Programming Mentor
AKA: Joe S
FRC #2474 (Team Excel)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2012
Location: Niles MI
Posts: 284
DjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to behold
Re: GetLocation() or GetAlliance()

You can actually read the joysticks during disabled. I setup a snippet of code this week to read the driver joystick and check if the trigger is held for 3 seconds, and switch to a different autonomous routine.
For reference, here's that chunk out of my code
Code:
static Timer button_combo_timer;
if (BUTTON_COMBO_SWITCH_AUTONOMOUS() == true)
{
    button_combo_timer.Start();
}
else
{
    button_combo_timer.Reset();
    button_combo_timer.Stop();
}

if (button_combo_timer.Get() > 3.00)
{
    button_combo_timer.Reset();
    switch (autonomousMode)
    {
    case AUTONOMOUS_MODE_1:
        autonomousMode = AUTONOMOUS_MODE_2;
    break;
    case AUTONOMOUS_MODE_2:
        autonomousMode = AUTONOMOUS_MODE_3;
    break;
    case AUTONOMOUS_MODE_3:
        autonomousMode = AUTONOMOUS_MODE_1;
    break;
    }
}
switch (autonomousMode)
{
    default:
    case AUTONOMOUS_MODE_1:
    driverStationLCD->PrintfLine((DriverStationLCD::Line) 3, "Using 1");
    break;
    case AUTONOMOUS_MODE_2:
    driverStationLCD->PrintfLine((DriverStationLCD::Line) 3, "Using 2");
    break;
    case AUTONOMOUS_MODE_3:
    driverStationLCD->PrintfLine((DriverStationLCD::Line) 3, "Using 3");
    break;
}
driverStationLCD->UpdateLCD();
Reply With Quote