Prints handbrake position percentage over Serial.
const int Pin_Handbrake = A2;
void setup() {
Serial.begin(115200);
while (!Serial);
Serial.println("Starting...");
}
void loop() {
if (Serial.read() != -1) {
delay(2000);
}
Serial.print("Handbrake: ");
Serial.print(pos);
Serial.print("%");
Serial.println();
delay(100);
}
Header file for the Sim Racing Library.
Interface with analog handbrakes that use hall effect sensors.
virtual void begin()
Initializes the pin for reading from the handbrake.
long getPosition(long rMin=0, long rMax=100) const
Retrieves the buffered position for the handbrake axis, rescaled to a nominal range using the calibra...
virtual bool update()
Polls the handbrake to update its position.
void serialCalibration(Stream &iface=Serial)
Runs an interactive calibration tool using the serial interface.