Exemple #1
0
 public static void main(String[] args) {
   PropertyConfigurator.configure(
       testArduinoBridge.class.getResourceAsStream("/config/log4j.properties"));
   Motor.smart_car_set(5000, 80);
   Utils.delay(5000);
   Motor.set_clockwise();
   Utils.delay(5000);
   Motor.smart_car_set(0, 0);
 }
Exemple #2
0
  public static void main(String[] args) throws InterruptedException {
    PropertyConfigurator.configure(
        testArduinoBridge.class.getResourceAsStream("/config/log4j.properties"));
    //        SystemCoreData.setSystemState(SystemCoreData.STATE_STILL);             //set still
    SensorGyro gyroTest = new SensorGyro();
    SensorAcc accTest = new SensorAcc();
    SystemCoreData.setSystemState(SystemCoreData.STATE_STILL);
    gyroTest.calibrate(100);
    accTest.calibrate(100);
    //        Motor.set_coufnterclockwise();
    Motor.smart_car_set(50, 0);

    while (true) {
      if (accTest.getSensorData().gety() <= -0.5) {
        break;
      }
    }
    logger.info("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
    Motor.smart_car_set(0, 0);
  }