MCPcopy Create free account
hub / github.com/DexterInd/GoPiGo3 / runMotor

Method runMotor

Software/Java/src/main/java/GoPiGo3.java:27–38  ·  view source on GitHub ↗
(int motor, int power)

Source from the content-addressed store, hash-verified

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);

Callers 3

stopMotorMethod · 0.95
stopMotorsMethod · 0.95
mainMethod · 0.95

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected