/** * Represents the speed of the motor as a floating point value between -1 * (full speed backward) and 1 (full speed forward) * @throws RuntimeIOException if an I/O error occurs * @return current value for this motor in the range -1 (backwards) to 1 (forwards) */ public float getValue() throws RuntimeIOException { if (forward.isOn()) { return 1; } else if (backward.isOn()) { return -1; } return 0; } }
/** * Represents the speed of the motor as a floating point value between -1 * (full speed backward) and 1 (full speed forward) * @throws RuntimeIOException if an I/O error occurs */ @Override public float getValue() throws RuntimeIOException { float speed = motorPwmControl.getValue(); return motorForwardControlPin.isOn() ? speed : -speed; }
if (! resetPin.isOn()) { Logger.debug("reset pin was off");