/** * Represents the speed of the motor as a floating point value between -1 * (full speed backward) and 1 (full speed forward). * @return current relative motor speed * @throws RuntimeIOException if an I/O error occurs */ @Override public float getValue() throws RuntimeIOException { return forward.getValue() - backward.getValue(); }
/** * 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; }