EIMSK = 0b00111111; // Re-enter the pool area for resuming collection if(edge == 1) { driveStraight(-85); ms_sleep(1000); turnLeft(-85); ms_sleep(2000); } if(edge == 2) { driveStraight(85); ms_sleep(1000); } state=6; edge=0; break; case 6: driveStraight(85); pumpOn(); ms_sleep(50); } // end switch } // end while // Shutdown sequence: state = 8; pumpOff(); while (edge == 0) { driveStraight(85); } brake(); EIMSK = 0b00000000; ms_sleep(20000); // Turn off power
EIMSK = 0b00111111; // Re-enter the pool area for resuming collection if(edge == 1) { driveStraight(-85); ms_sleep(1000); turnLeft(-85); ms_sleep(2000); } if(edge == 2) { driveStraight(85); ms_sleep(1000); } state=6; edge=0; break; case 6: driveStraight(85); pumpOn(); ms_sleep(50); } // end switch } // end while // Shutdown sequence: state = 8; pumpOff(); while (edge == 0) { driveStraight(85); } brake(); EIMSK = 0b00000000; ms_sleep(20000); // Turn off power