34const int Pin_Handbrake = A2;
39 JOYSTICK_DEFAULT_REPORT_ID,
40 JOYSTICK_TYPE_JOYSTICK,
45 false,
false,
false,
false,
false,
false,
false,
false);
47const int ADC_Max = 1023;
48const bool AlwaysSend =
false;
56 Joystick.begin(
false);
57 Joystick.setZAxisRange(0, ADC_Max);
70void updateJoystick() {
72 Joystick.setZAxis(pos);
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...
bool positionChanged() const
Checks whether the handbrake's position has changed since the last update.
virtual bool update()
Polls the handbrake to update its position.