(int motor, int power)
| 25 | |
| 26 | |
| 27 | public void runMotor(int motor, int power) throws IOException { |
| 28 | |
| 29 | //TODO Create a Builder |
| 30 | byte command[] = new byte[] { |
| 31 | (byte) 8, // first byte, start bit |
| 32 | (byte) 10, // SET_MOTOR_PWM |
| 33 | (byte) motor, // 1 | 2 |
| 34 | (byte) power, // 0 - 100 |
| 35 | }; |
| 36 | |
| 37 | this.spi.write(command); |
| 38 | } |
| 39 | |
| 40 | public void stopMotor(int motor) throws IOException { |
| 41 | this.runMotor(motor, 0); |
no test coverage detected