DriverStation/RobotThread.java
// Continuously sends the motor values that it's joystick detects

Continuously sends the motor values that it's joystick detects
Continuously sends the motor values that it ' s joystick detects
public void run() {
        System.out.println("Started thread");
        DataOutputStream out;
        DataInputStream in;
        try {
            out = new DataOutputStream(socket.getOutputStream());
            in = new DataInputStream(socket.getInputStream());
        } catch (IOException e) {
            System.out.println("RobotThread could not get socket's streams");
            callback.accept(this);
            return;
        }
        while (!Thread.currentThread().isInterrupted()) {
            try {
            	int[] motorVals = joystick.getMotor();
            	byte[] bytes = new String("("+motorVals[0]+";"+motorVals[1]+")").getBytes();
            	out.write(bytes, 0, bytes.length);
            	System.out.println("Sent something");
                in.readChar();
                System.out.println("Got something");
            } catch (Exception e) {
                e.printStackTrace();
            	break;
            }
        }
        callback.accept(this);
    }
public void run ( ) { System . out . println ( "Started thread" ) ; DataOutputStream out ; DataInputStream in ; try { out = new DataOutputStream ( socket . getOutputStream ( ) ) ; in = new DataInputStream ( socket . getInputStream ( ) ) ; } catch ( IOException e ) { System . out . println ( "RobotThread could not get socket's streams" ) ; callback . accept ( this ) ; return ; } while ( ! Thread . currentThread ( ) . isInterrupted ( ) ) { try { int [ ] motorVals = joystick . getMotor ( ) ; byte [ ] bytes = new String ( "(" + motorVals [ 0 ] + ";" + motorVals [ 1 ] + ")" ) . getBytes ( ) ; out . write ( bytes , 0 , bytes . length ) ; System . out . println ( "Sent something" ) ; in . readChar ( ) ; System . out . println ( "Got something" ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; break ; } } callback . accept ( this ) ; }
Continuously sends the motor values that it's joystick detects
Continuously sends the motor values that it ' s joystick detects