Пример #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();
   }
 }
Пример #2
0
  private void followLine(boolean startChainBridge) {
    this.lineFollowing = new LineFollowing(drive, colorSensor);
    lineFollowing.run(startChainBridge);

    // 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);
    } else if (RACE_MODE && PROGRAM_STATUS == PROGRAM_BRIDGE) {
      PROGRAM_CHANGED = false;
      LCD.clear();
      System.out.println("Mode: Bridge");
      bridge();
    }
  }