Exemplo n.º 1
0
 /*
  * Terminates all programs that might currently run.
  */
 private void endAllPrograms() {
   if (barcode != null) {
     barcode.end();
   }
   if (lineFollowing != null) {
     lineFollowing.end();
   }
   if (maze != null) {
     maze.end();
   }
   if (bridge != null) {
     bridge.end();
   }
   if (elevator != null) {
     elevator.end();
   }
   if (seesaw != null) {
     seesaw.end();
   }
   if (chainBridge != null) {
     chainBridge.end();
   }
   if (rolls != null) {
     rolls.end();
   }
   if (finalSpurt != null) {
     finalSpurt.end();
   }
   if (endboss != null) {
     endboss.end();
   }
 }
Exemplo n.º 2
0
  /*
   * Initializing the bridge mode.
   */
  private void bridge() {
    this.bridge = new Bridge(drive, sonicMotor, leftMotor, rightMotor, sonicSensor, colorSensor);
    bridge.run();

    // Change bridge -> elevator
    if (RACE_MODE && PROGRAM_CHANGED && PROGRAM_STATUS == PROGRAM_ELEVATOR) {
      PROGRAM_CHANGED = false;
      LCD.clear();
      System.out.println("Mode: Elevator");
      elevator();
    }
  }