Beispiel #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();
   }
 }
Beispiel #2
0
  /*
   * Initializing the elevator mode.
   */
  private void elevator() {
    this.elevator =
        new Elevator(
            drive, colorSensor, touchLeftSensor, touchRightSensor, sonicSensor, sonicMotor);
    elevator.run();

    // Start search for barcode.
    if (RACE_MODE && PROGRAM_FINISHED_START_BARCODE) {
      PROGRAM_FINISHED_START_BARCODE = false;
      LCD.clear();
      System.out.println("Mode: Barcode");
      barcode(true);
    }
  }