/* Psuedocode
Ramp Forward -> [Cross Barrier] -> Raise Arm HIGH -> Hold Arm HIGH -> Ramp Zero -> [Reach Goal] -> Outtake -> [Finish Outtake]
-> Stop Intake -> Ramp Forward -> Ramp Zero -> [Reach Barrier] -> Lower Arm LOW -> Ramp Backward -> [Reach Square] -> Hard Zero
Wait Until Press -> Raise Arm BARRIER -> Hold Arm BARRIER -> Ramp Forward -> Ramp Zero -> [Reach Barrier] -> Ramp Backward
-> [Reach Square] -> Hard Zero -> Wait Until Press -> Ramp Forward -> Ramp Zero -> [Reach Barrier]
*/
void Alex() // Caches preload (5) + Knocks 2 big balls (10)
{
	deploy();
	moveStraight(1, 0, 1550); // 1600 is just before goal...changed for some reason
	lift(HIGH); // only accurate to the nearest 100... may need to adjust HIGH value
	holdArm();
	moveStraight(1, 0, 300); // reaches goal
	//wait1Msec(1000);
	intake(false);
	wait1Msec(1000); // outtake
	stopIntake();
	moveStraight(-1, 0, 400); // move back away from goal...Apparently Safety is greater than move forward
	liftDown();
	moveStraight(-1, 0, 1500);
	waitForButton();
	lift(BARRIER);
	holdArm();
	intake(false);
	moveStraight(1, 0, 550); // estimated guess based on 10Q's values - WORKS
	wait1Msec(300);
	moveStraight(-1, 0, 550);
	waitForButton();
	moveStraight(1, 0, 950); // A bit of trouble... Not sure if you want to spin rollers for this hit...
	wait1Msec(300); // outtaking pushes the ball away + needs good aiming
	moveStraight(-1, 0, 950);
	resetValues(100);
}
Exemplo n.º 2
0
void Scoremiddlegoal()
{  waitForButton();
  starttask(CollectD);
  {
    drive_Enc(63,7,4);
  }
  stopdrivemotors();
  StopTask(CollectD);
  StartTask(medgoal);
  {

    stopTime(1.75);//wait for arm
    drive_Enc(63,8,5);//drive foward
  }
  StopTask(medgoal);
  spit(0.75);
  drive_Enc(-63,4,2);
  spit(0.75);
  StartTask(armDown);
  {
    drive_Enc(-63,15,5);
  }
  StopTask(armDown);
  waitForButton();
  StartTask(CollectD);
  {
    drive_Enc(70,15,5);
  }
  StopTask(CollectD);

}
void redDevansh() // Places preload (1-2) + 2 buckies (2-4) + TURN LEFT Knocks buckies (1-6)
{
	deploy();
	intake(1);
	wait10Msec(10);
	moveStraight(1, 0, 455); //picks up
	wait10Msec(50);
	moveStraight(-1, 0, 475);//comes back
	intake(0);
			// end part 1: prepare dump
	waitForButton();
	lift(BUMP);
	holdArm();
	intake(-1);
	resetValues(1200);
		// end part 2: dump
	waitForButton();
	liftDown();
	wait10Msec(100);
	moveStraight(1, 0, 700);
		// end part 3: prepare hit
	spin(-1, 0, 200);
	intake(-1);
	lift(BUMP);
	holdArm();
	noRamp(1, 250);
	resetValues(0);
		// end part 4: hit
}
Exemplo n.º 4
0
	void AlexAlt() // Caches preload (5) + Knocks 2 big balls (10)
	{
		deploy();
		moveStraight(1, 0, 1600); // maintenence and recalibrating needed
		liftTime(1,300);
		holdArmHigh();
		moveStraight(1, 0, 650); // reaches goal
		//wait1Msec(1000);
		intake(-1);
		wait1Msec(500); // outtake
		moveStraight(-1, 0, 400); //move back away from goal...Apparently Safety is greater than move forward
		liftDown();
			// end score bucky
		moveStraight(-1, 0, 1400); // now user readjust for first ball
		waitForButton();
		lift(BARRIER);
		holdArm();
		intake(-1);
		moveStraight(1, 0, 580); //estimated guess based on 10Q's values
		wait1Msec(300);
		//moveStraight(-1, 0, 550);
		moveStraight(-1, 0, 580);
		waitForButton();
		moveStraight(1, 0, 950);
		wait1Msec(300);
		//moveStraight(-1, 0, 950);
		moveStraight(-1, 0, 950);
		resetValues(100);
	}
Exemplo n.º 5
0
	void Alex2() // Knocks 2 big balls (10) then caches preload
	{
		deploy();

		lift(BARRIER);
		holdArm();
		intake(-1);
		moveStraight(1, 0, 580); //estimated guess based on 10Q's values
		wait1Msec(300);
		//moveStraight(-1, 0, 550);
		moveStraight(-1, 0, 580);

		waitForButton();
		moveStraight(1, 0, 950);
		wait1Msec(300);
		//moveStraight(-1, 0, 950);
		moveStraight(-1, 0, 950);
		resetValues(100);

		waitForButton();
		moveStraight(1, 0, 1420); // maintenence and recalibrating needed
		lift(HIGH); // nearest 100
		holdArmHigh();
		moveStraight(1, 0, 500); // reaches goal
		//wait1Msec(1000);
		intake(-1);
		wait1Msec(500); // outtake
		moveStraight(-1, 0, 400); //move back away from goal...Apparently Safety is greater than move forward
		motor[LeftArm] = motor[RightArm] = -127;
		wait1Msec(800);
		motor[LeftArm] = motor[RightArm] = 0;
			// end score bucky
		moveStraight(-1, 0, 1300); // now user readjust for first ball
	}
void redUdit()
{
	deploy();
	intake(1);
	wait10Msec(10);
	moveStraight(1, 0, 475); //picks up
	wait10Msec(50);
	moveStraight(-1, 0, 475);//comes back
	//intake(0)();
	spin(1, 0, 400);
	lift(BUMP);
	holdArm();
	waitForButton();
	intake(-1);
	wait10Msec(100);
	resetValues(0);
	liftDown(); // added
	// end Devansh
	waitForButton();
	intake(1);
	moveStraight(1, 0, (HALF_TILE));
	wait10Msec(50);
	pickUpBall(1);
	spin(-1, 0, 200);
	crossBump();
	lift(BARRIER);
	holdArm();
	wait10Msec(30);
	moveStraight(1, 0, 550);
	intake(-1);
	// end udit
	resetValues(1000);
}
	/* Psuedocode
			 Ramp Forward -> [Cross Barrier] -> Raise Arm HIGH -> Hold Arm HIGH -> Ramp Zero -> [Reach Goal] -> Outtake -> [Finish Outtake]
			 	-> Stop Intake -> Ramp Forward -> Ramp Zero -> [Reach Barrier] -> Lower Arm LOW -> Ramp Backward -> [Reach Square] -> Hard Zero
			 Wait Until Press -> Raise Arm BARRIER -> Hold Arm BARRIER -> Ramp Forward -> Ramp Zero -> [Reach Barrier] -> Ramp Backward
			 	-> [Reach Square] -> Hard Zero -> Wait Until Press -> Ramp Forward -> Ramp Zero -> [Reach Barrier]
	*/
	void Alex() // Caches preload (5) + Knocks 2 big balls (10)
	{
		deploy();
		moveStraight(1, 0, 1600); // 1600 is just before goal
		lift(HIGH); // nearest 100
		holdArm();
		moveStraight(1, 0, 300); // reaches goal
		//wait1Msec(1000);
		intake(-1);
		wait1Msec(500); // outtake
		intake(0);
		moveStraight(-1, 0, 400); //move back away from goal...Apparently Safety is greater than move forward
		liftDown();
		moveStraight(-1, 0, 1500);
		waitForButton();
		lift(BARRIER);
		holdArm();
		intake(-1);
		moveStraight(1, 0, 550); //estimated guess based on 10Q's values
		wait1Msec(300);
		moveStraight(-1, 0, 550);
		waitForButton();
		moveStraight(1, 0, 950);
		wait1Msec(300);
		moveStraight(-1, 0, 950);
		resetValues(100);
	}
void redUdit()
{
	deploy();
	intake(true);
	wait10Msec(10);
	moveStraight(1, 0, 475);
	wait10Msec(50);
	moveStraight(-1, 0, 475);
	//stopIntake();
	lift(BUMP);
	holdArm();
	waitForButton();
	intake(false);
	wait10Msec(100);
	waitForButton();
	resetValues(0);
	liftDown();
	// end Devansh
	waitForButton();
	intake(true);
	moveStraight(1, 0, (HALF_TILE));
	wait10Msec(50);
	pickUpBall(1);
	spin(-1, 0, 200);
	crossBump();
	lift(BARRIER);
	holdArm();
	wait10Msec(30);
	moveStraight(1, 0, 550);
	intake(false);
	// end udit
	resetValues(1000);
}
void redDevansh() // Places preload (1-2) + 2 buckies (2-4) + TURN LEFT Knocks buckies (1-6) + Places two Balls (2)
{
	deploy();
	intake(true);
	wait10Msec(10);
	moveStraight(1, 0, 475);
	wait10Msec(50);
	moveStraight(-1, 0, 475);
	//stopIntake();
	lift(BUMP);
	holdArm();
	waitForButton();
	intake(false);
	wait10Msec(100);
	waitForButton();
	resetValues(0);
	liftDown();
	// end Devansh
	waitForButton();
	intake(true);
	moveStraight(1, 0, (HALF_TILE));
	wait10Msec(50);
	pickUpBall(1);
	spin(-1, 0, 200);
	crossBump();
	lift(BARRIER);
	holdArm();
	wait10Msec(30);
	moveStraight(1, 0, 550);
	intake(false);
	// end udit
	resetValues(1000);
}
void blueUdit()
{
	deploy();
	intake(1);
	wait10Msec(10);
	moveStraight(1, 0, 475); //picks up
	wait10Msec(50);
	moveStraight(-1, 0, 475);//comes back
	//intake(0)();
	spin(1, 0, 400);
	lift(BUMP);
	holdArm();
	waitForButton();
	intake(-1);
	wait10Msec(100);
	resetValues(0);
	liftDown(); // added

	waitForButton();
	//liftDown();
	// end Devansh
	//waitForButton();
	intake(1);
	moveStraight(1, 0, (HALF_TILE));
	wait10Msec(50);
	pickUpBall(1);
	spin(1, 0, 200);
	//crossBump();
	lift(BUMP);
	nMotorEncoder[LeftMWheel] = 0;
	if(true)
	{
		setRight(127);
		wait10Msec(10);
		setLeft(127);
	}
	while (abs(nMotorEncoder[LeftMWheel]) < 500)
	{
		setRight(127); setLeft(127);
	}
	setRight(0); setLeft(0);
	lift(BARRIER);
	holdArm();
	wait10Msec(30);
	moveStraight(1, 0, 550);
	intake(-1);
	// end udit
	resetValues(1000);
}
Exemplo n.º 11
0
  void skills()
  {
  	deploy();

  	wait10Msec(20);
    intakeSlow(1);
		moveStraight(1, 0, 430); //picks up
		wait10Msec(50);
		moveStraight(-1, 0, 430);//comes back
		intake(1);


		lift(BUMP - 50);
		holdArm();
		moveStraight(-1,0,700);//hops bump
		waitForButton();

	  liftDown();
	  intake(0);

  	waitForButton();
		moveStraight(1, 0, 1400); // maintenence and recalibrating needed
		wait10Msec(30);
		lift(HIGH);
		holdArmHigh();
		moveStraight(1, 0, 430); // reaches goal
		//wait1Msec(1000);
		intake(-1);
		wait10Msec(150); // outtake
		moveStraight(-1, 0, 400); //move back away from goal...Apparently Safety is greater than move forward
		lift(LOW);
		wait10Msec(50);

		intake(0);
			// end score bucky
		moveStraight(-1, 0, 1400); // now user readjust for first ball
		waitForButton();

		moveStraight(1,0,600);
	  spin(1,0,200);
	  lift(BARRIER);
		holdArmHigh();
		moveStraight(1, 0, 475);
		wait10Msec(40);
		moveStraight(-1, 0, 275);


	}
void blueBrian()
{
		moveStraight(1, 0, 1000); // estimate going 2 tiles, under bump perpendicular to barrier
		wait10Msec(30); // stableeeeeeeeeeeeeeeee hit ball gently?
		spin(-1, 0, 100); // uh... hopefully it doesn't fall out?
		//wait10Msec(70); 1 sec stabilization time already incorporated in spin()
		lift(HIGH); // uh..
		holdArmHigh();
		wait10Msec(70);
		moveStraight(1, 0, 450);
		wait10Msec(70);
		intake(-1);
		wait10Msec(10); // lol
		intake(0);
		moveStraight(-1, 0, 200); // lol
		intake(-1); // lol
		wait10Msec(20);
		intake(0);
		moveStraight(-1, 0, 250);
		resetValues(0);
		liftDown();
		spin(1, 0, 100);
		moveStraight(-1, 0, 1000);
		waitForButton();
		// end 15 pts

		lift(BARRIER);
		holdArm();
		moveStraight(1, 0, 950);
		// end 5 pts, or 20pts total
}
	void redDevansh() // Places preload (1-2) + 2 buckies (2-4) + TURN LEFT Knocks buckies (1-6) + Places two Balls (2)
	{
			deploy();
			intake(1);
			wait10Msec(10);
			moveStraight(1, 0, 150); // 200 estimated based on 10Q values
			wait10Msec(50);
			moveStraight(-1, 0, 150);
			intake(0);
			waitForButton();
			lift(BUMP);
			holdArm();
			intake(-1);
			waitForButton();
			resetValues(0);
			liftDown();
			wait10Msec(20);
			intake(1);
			moveStraight(1, 0, (TILE + HALF_TILE)); // theory
			wait10Msec(50); // intake ball hopefully
			lift(BUMP);
			holdArm();
			intake(0);
			spin(0, -1, RIGHT_ANGLE); // RED SIDE TURN LEFT knocks buckies hopefully
			wait10Msec(30);
			intake(-1); // outtake ball hopefully
			wait10Msec(300);
			intake(0);
			spin(0, 1, RIGHT_ANGLE);
			liftDown();
			intake(1);
			moveStraight(1, 0, (TILE + HALF_TILE)); // theory
			lift(BUMP);
			holdArm();
			intake(0);
			spin(0, -1, RIGHT_ANGLE); // RED SIDE TURN LEFT
			wait10Msec(30);
			intake(-1);
			resetValues(10);
	}
Exemplo n.º 14
0
void hangSide() {
	motor(Intake1) =motor(Intake2) = 127;
	forward(34);
	wait1Msec(1500);
	back(60);
	basicMove(0, 0, 0);
	wait1Msec(2000);
	/*raiseArm(300);
	outtakeT(2000);*/
	motor(Intake1) = motor(Intake2) = 0;
	powerArm(0);
	basicMove(0, 0, 0);
	raiseArm(600);
	powerArm(20);
	waitForButton();
	outtakeT(3500);
	basicMove(0, 0, 0);
	powerArm(0);
	basicMove(0, 0, 0);
}
Exemplo n.º 15
0
	void redUdit()
	{
		deploy();
		wait10Msec(20);
		moveStraight(1, 0, 450); //picks up
		wait10Msec(50);
		moveStraight(-1, 0, 450);//comes back
		intake(0);

		waitForButton();
		moveStraight(1, 0, (610));
		spin(-1,0, 240);
		moveStraight(1, 0, (575));
		lift(BARRIER - 300);
		holdArm();
		intake(-1);
		wait10Msec(130);
		liftDown();
		intake(0);

	}
Exemplo n.º 16
0
// Most basic, scores preload, knocks over big balls.
void forGreaterJustice() {
	setTank();
	forward(1100);
	raiseArm(1200);
	powerArm(10);
	//back(50);
	basicMove(0, 0, 0);
	motor(Intake1) =motor(Intake2) = -127;
	wait1Msec(800);
	back(400);
	motor(Intake1) =motor(Intake2) = 0;
	lowerArm(10);
	back(600);
	basicMove(0, 0, 0);
	waitForButton();
	// Push over big balls
	//raiseArm(650);
	powerArm(0);
	//stopArm();
	motor[Arm1] = motor[Arm2] = 0;
	forLols();
}
Exemplo n.º 17
0
	void RedSai() //potential 20pt auton
	{
		deploy();

		// go for second ball knockdown
		moveStraight(1, 0, 950);
		wait1Msec(300);
		moveStraight(-1, 0, 950);
		resetValues(100);

		waitForButton();
		moveStraight(1,0,1500); //move forward
		spin(-1,0,180); // turn towards the cache
		lift(HIGH); // nearest 100
		holdArmHigh();
		moveStraight(1, 0, 650); // reaches goal
		intake(-1);
		wait1Msec(1000); // outtake




	}
Exemplo n.º 18
0
int main(int argc, char *argv[])
{
    char c;
    int status = 0;
    
    printf("Hello World, I'm game!\n");
    
    status = init_display();
    if (status != 0)
    {
        printf("Error: Failed to init display\n");
        return status;
    }
    
    status = init_driver();
    if (status != 0)
    {
        printf("Error: Failed to init driver\n");
        destroy_display();
        return status;
    }
    
    status = setup_handler();
    if (status != 0)
    {
        printf("Error: Failed to init signal handler\n");
        destroy_display();
        close(file_gamepad_driver);
        return status;
    }
    time_handler();
    
    /* Intializes random number generator */
    srand((unsigned) time(&t));
    
    sigset_t myset;
    (void) sigemptyset(&myset);

    while(1)
    {
        clear_LCD();       
        draw_game();
        draw_score(p1_score, p2_score);
        redraw();
        
        waitForButton();      
        printf("start game\n");
        
        while((p1_score < 5) && (p2_score < 5))
        {
            random_timer = (rand() % 3) + 2;
            startTimer(random_timer);
            waitForTimer();
            
            random_button = (rand() % 4);
            
            draw_button(random_button, true, RED);
            redraw();
            
            gettimeofday(&time_button_appears, NULL);

            // start timer
            startTimer(3);
            buf = 0;
            while((playerButtonPressed(random_button) == 0) && (timer_expired == false))
            {
                waitForButton(); 
            }
            
            stopTimer();
            if (timer_expired == false)
            {
                time_elapsed = getGameTime();
                draw_time(time_elapsed, BLUE);
                redraw();
            }
      
            if (playerButtonPressed(random_button) == P1)
            {
                p1_score++;
                p1_time += time_elapsed;
                
            }
            else if (playerButtonPressed(random_button) == P2)
            {
                p2_score++;    
                p2_time += time_elapsed;
            }
                
            draw_score(p1_score, p2_score);    
            reset_button(random_button);
            redraw();
            
        }
        // draw winner
        button_pressed = 0;
        if (p1_score == 5)
        {
            winner = P1;
            winner_time = p1_time;
        }
        else if (p2_score == 5)
        {
            winner = P2;
            winner_time = p2_time;
        }
        
        while(button_pressed == 0)
        {
            startTimer(1);
            winner_blink(winner, winner_time);
            waitForTimer();
        }
               
        // print waiting
        waitForButton();
        p1_score = 0;
        p1_time = 0;
        p2_score = 0;
        p2_time = 0;
    }

}
Exemplo n.º 19
0
void doChat() {
  //Setup chat
  _maxCharsPerRow = (display.width() / ANX_FONT_WIDTH) - 2;
  _bottom = CHAT_MESSAGES_MAX - 1;

  uint8_t button = 0;
  uint8_t lastChatPtr = 0;
  bool quit = false;

  //Warn user then quit if radio is not available
  if (!ANXRFAvailable()) {
    statusDialog("Radio disabled");
    quit = true;
  }

  //Warn user then quit if in airplane mode
  if (ANXGetAirplane()) {
    statusDialog("Badge is in\nairplane mode");
    quit = true;
  }

  if (quit) {
    waitForButton();
    clearButtonState();
    return;
  }

  while (1) {
    _drawMessages();
    lastChatPtr = chatBufferPtr;

    //Idle handling RF and buttons
    while (chatBufferPtr == lastChatPtr && button == 0) {
      //Handle tasks
      tick();
      //Check buttons
      button = getButtonState();
    }

    //Handle button presses in one block
    //If message is null, meaning nothing was passed into doChat, then execute a normal chat entry.
    if (button > 0) {
      //Quit on left
      if (button == BUTTON_LEFT) {
        clearButtonState();
        return;
      }

      //Popup chat window on enter
      if (button == BUTTON_ENTER) {
        clearButtonState();

        //Get a
        char message[ANX_CHAT_MAX_LENGTH];
        memset(message, '\0', ANX_CHAT_MAX_LENGTH); //initialize to null before using no matter wut
        ANXInputWindow(message, mi_main_chat, ANX_CHAT_MAX_LENGTH);
        if (strlen(message) > 0) {
          ANXRFSendChat(message);
        }
      }
    }
    //cleanup
    button = 0;
  }
}
  void skills()
  {
  	Alex(); // 15 points
  	liftDown();
  	waitForButton();
  	wait10Msec(50);
  	while(SensorValue[waitingButtonRed] == 0 && SensorValue[waitingButtonBlue] == 0)
  	{
  		setRight(127); setLeft(127);
  	} // this works for crossing bump
  	resetValues(0); // I don't know why it doesn't reach here...
  		// end cross bump
  	waitForButton();

   	intake(1);
		wait10Msec(10);
		moveStraight(1, 0, 455); //picks up
		wait10Msec(50);
		moveStraight(-1, 0, 475);//comes back
  		// end pick up 3

		waitForButton();

		wait10Msec(50);
  	while(SensorValue[waitingButtonRed] == 0 && SensorValue[waitingButtonBlue] == 0)
  	{
  		setRight(127); setLeft(127);
  	}
  	resetValues(0);
	  	// end cross bump
	  	waitForButton();
	  	moveStraight(1, 0, 1400); // 1600 is just before goal
			lift(HIGH); // nearest 100
			holdArmHigh();
			moveStraight(1, 0, 350); // reaches goal
			intake(-1);
			wait1Msec(500); // outtake
			moveStraight(-1, 0, 400); //move back away from goal...Apparently Safety is greater than move forward
			liftDown();
			moveStraight(-1, 0, 1500);
			resetValues(0);
		// end Alex 2.0
		waitForButton();
		wait10Msec(50);
  	while(SensorValue[waitingButtonRed] == 0 && SensorValue[waitingButtonBlue] == 0)
  	{
  		setRight(127); setLeft(127);
  	}
  	setRight(0); setLeft(0);
  	// end cross

  	waitForButton();
  	intake(1);
  	wait10Msec(100);
  	moveStraight(1, 0, 700);
  	resetValues(50);
  	// end intake big ball
  	moveStraight(-1, 0, 200);
  	softSpin(-1, 0, 200);
  	intake(-1);
  	resetValues(1200);
  	// end outtake
  	spin(1, 0, 200);
  	intake(1);
  	moveStraight(1, 0, 900);
  	intake(0);
  	wait10Msec(30);
  	moveStraight(-1, 0, 200);
  	softSpin(-1, 0, 200);

	}
Exemplo n.º 21
0
	void crossBump()
	{
		setRight(127); setLeft(127);
		waitForButton();
		setRight(0); setLeft(0);
	}
Exemplo n.º 22
0
/**
   Interactively accepts input from the user
   Max input size is determined by remaining cells at given start row. No scrolling.
*/
void ANXInput(char *message, uint8_t startX, uint8_t startY, uint8_t maxChars, uint8_t maxCharsPerRow) {
  int messageLen = strlen(message);             //Size of the message
  int cursor = messageLen;       //Location of cursor in the text, put cursor at end of message to continue
  uint8_t row = 0;          //Row of the cursor
  uint8_t col = 0;          //Col of the cursor
  uint8_t cindex = 0;   //index within input char array
  int maxCols = (display.width() - startX) / ANX_FONT_WIDTH;    //Max number of cols available
  int maxRows = (display.height() - startY) / ANX_FONT_HEIGHT;  //Max number of rows available
  int maxLen = min(maxCols * maxRows, maxChars);           //Maximum possible size of the message (limited by input space and buffer)

  //Use the user specified chars per row if specified
  if (maxCharsPerRow > 0) {
    maxCols = min(maxCharsPerRow, maxCols);
  }

  //Print the message, if any
  ANXInputMoveCursor(row, col, startX, startY);
  display.print(message);

  //Iteractively get input from user
  while (1) {
    row = cursor / maxCols;
    col = cursor % maxCols;

    ANXInputClearChar(row, col, startX, startY);
    ANXInputDrawCursor(row, col, startX, startY);

    if (message[cursor] != NULL) {
      ANXInputMoveCursor(row, col, startX, startY);
      display.print(message[cursor]);
    }

    safeDisplay();

    uint8_t button = waitForButton();
    if ((button & BUTTON_DOWN) > 0) {

      //Move char index to the end pro-actively since unsigned won't wrap to -1
      if (cindex == 0) cindex = INPUT_CHARS_COUNT;
      cindex--;

      if (cursor >= messageLen) {
        messageLen++;
      }
      message[cursor] = INPUT_CHARS[cindex];

      //Make sure we're not null terminating the string early
      if (cursor > 0) {
        if (message[cursor - 1] == '\0') message[cursor - 1] = ' ';
      }

      deepSleep(BUTTON_REPEAT_DELAY);
    }

    if ((button & BUTTON_UP) > 0) {
      cindex++;
      if (cindex >= INPUT_CHARS_COUNT) cindex = 0;
      if (cursor >= messageLen) {
        messageLen++;
      }
      message[cursor] = INPUT_CHARS[cindex];

      //Make sure we're not null terminating the string early
      if (cursor > 0) {
        if (message[cursor - 1] == '\0') message[cursor - 1] = ' ';
      }

      deepSleep(BUTTON_REPEAT_DELAY);
    }

    if ((button & BUTTON_RIGHT) > 0) {
      ANXInputDrawCursor(row, col, startX, startY);

      //Prevent cursor from going off the deep end
      if (cursor < maxLen - 1) {
        cursor++;
      }

      if (cursor < messageLen) {
        cindex = ANXIndexOf(INPUT_CHARS, message[cursor]);
      } else {
        messageLen++;
        cindex = 0;
      }

      //Make sure we're not null terminating the string early
      if (cursor > 0) {
        if (message[cursor - 1] == '\0') message[cursor - 1] = ' ';
      }

      //Don't allow repeats
      clearButtonState();
    }

    if ((button & BUTTON_LEFT) > 0) {
      //Prevent cursor underun
      if (cursor > 0) {
        ANXInputDrawCursor(row, col, startX, startY);
        cursor--;
      }

      if (cursor < messageLen) {
        cindex = ANXIndexOf(INPUT_CHARS, message[cursor]);
      } else {
        messageLen++;
        cindex = 0;
      }

      //Don't allow repeats
      clearButtonState();
    }

    if ((button & BUTTON_ENTER) > 0) {
      //Don't allow repeats
      clearButtonState();
      return;
    }
  }
}
	bool touch()
	{

	{

	void crossBump()
	{
		/*
		lift(BUMP);
		holdArm();
		nMotorEncoder[LeftMWheel] = 0;
		while(abs(nMotorEncoder[LeftMWheel]) < 300)
		{
			setRight(100); setLeft(100);
		}
		while(abs(nMotorEncoder[LeftMWheel]) < 600)
		{
			setRight(50); setLeft(50);
		}
		while(abs(nMotorEncoder[LeftMWheel]) < 800)
		{
			setRight(35); setLeft(35);
		}
		//liftDown();
		setRight(0); setLeft(0);
		//resetValues(0);
		*/

	}

	/* Psuedocode
			 Ramp Forward -> [Cross Barrier] -> Raise Arm HIGH -> Hold Arm HIGH -> Ramp Zero -> [Reach Goal] -> Outtake -> [Finish Outtake]
			 	-> Stop Intake -> Ramp Forward -> Ramp Zero -> [Reach Barrier] -> Lower Arm LOW -> Ramp Backward -> [Reach Square] -> Hard Zero
			 Wait Until Press -> Raise Arm BARRIER -> Hold Arm BARRIER -> Ramp Forward -> Ramp Zero -> [Reach Barrier] -> Ramp Backward
			 	-> [Reach Square] -> Hard Zero -> Wait Until Press -> Ramp Forward -> Ramp Zero -> [Reach Barrier]
	*/
	void Alex() // Caches preload (5) + Knocks 2 big balls (10)
	{
		deploy();

		moveStraight(1, 0, 1550); // 1600 is just before goal
		lift(HIGH); // nearest 100
		holdArmHigh();
		moveStraight(1, 0, 300); // reaches goal
		//wait1Msec(1000);
		intake(-1);
		wait1Msec(500); // outtake
		moveStraight(-1, 0, 400); //move back away from goal...Apparently Safety is greater than move forward
		liftDown();
			// end score bucky
		moveStraight(-1, 0, 1400); // now user readjust for first ball
		waitForButton();
		lift(BARRIER);
		holdArm();
		intake(-1);
		moveStraight(1, 0, 580); //estimated guess based on 10Q's values
		wait1Msec(300);
		//moveStraight(-1, 0, 550);
		moveStraight(-1, 0, 580);
		waitForButton();
		moveStraight(1, 0, 950);
		wait1Msec(300);
		//moveStraight(-1, 0, 950);
		moveStraight(-1, 0, 950);
		resetValues(100);
	}

void blueDevansh() // Places preload (1-2) + 2 buckies (2-4) + TURN RIGHT Knocks buckies (1-6)
{
	deploy();
	intake(1);
	wait10Msec(10);
	moveStraight(1, 0, 455); //picks up
	wait10Msec(50);
	moveStraight(-1, 0, 475);//comes back
	intake(0);
			// end part 1: prepare dump
	waitForButton();
	lift(BUMP);
	holdArm();
	intake(-1);
	resetValues(1200);
		// end part 2: dump
	waitForButton();
	liftDown();
	wait10Msec(100);
	moveStraight(1, 0, 700);
		// end part 3: prepare hit
	spin(1, 0, 200);
	intake(-1);
	lift(BUMP);
	holdArm();
	noRamp(1, 250);
	resetValues(0);
		// end part 4: hit
}