Beispiel #1
0
  /*
   * Start program to read a barcode. If a valid barcode could be found the
   * next program will be loaded.
   */
  private void barcode(boolean moveRobot) {
    this.barcode = new Barcode(drive, colorSensor, moveRobot);
    barcode.run();

    if (barcode != null) {
      int foundBarcode = barcode.getBarcode();
      LCD.clear();
      // System.out.println("Barcode: " + foundBarcode);

      if (foundBarcode != -1) {
        // Change the current program if a valid barcode has been found
        changeProgram(foundBarcode);
      }
    }
  }