public void start() { ev3.connect(); gyro = ev3.getGyroSensor(); left_motor = ev3.getMotorA(); right_motor = ev3.getMotorD(); // Optional code to accept BasicMotor: this.right_motor = (NXTMotor)right; // this.gyro = gyro; this.ratioWheel = wheelDiameter / 5.6; // Original algorithm was tuned for 5.6 cm NXT 1.0 wheels. // Took out 50 ms delay here. // Get the initial gyro offset getGyroOffset(); // Play warning beep sequence before balance starts // startBeeps(); // Start balance thread // this.setDaemon(true); // this.start(); // initialize (); // balance(); Thread t1 = new Thread(new ThreadStart(balance)); t1.Start(); // Thread t2 = new Thread (new ThreadStart (drive)); // t2.Start (); t1.Join(); // t2.Join (); ev3.disconnect(); }