30const int Pin_ShifterX = A0;
31const int Pin_ShifterY = A2;
32const int Pin_ShifterRev = 2;
37const unsigned long PrintSpeed = 1500;
38unsigned long lastPrint = 0;
49 Serial.println(
"Starting...");
54 if (Serial.read() != -1) {
62 Serial.print(
"Shifted into ");
65 Serial.print(shifter.
getGear());
68 Serial.print(
" - XY: (");
78 if(millis() - lastPrint >= PrintSpeed) {
79 Serial.print(
"Currently in ");
Header file for the Sim Racing Library.
void serialCalibration(Stream &iface=Serial)
Runs an interactive calibration tool using the serial interface.
int getPositionRaw(Axis ax) const
Retrieves the buffered position for the analog axis.
virtual bool update()
Polls the hardware to update the current gear state.
virtual void begin()
Initializes the hardware pins for reading the gear states.
Interface with the Logitech Driving Force shifter.
int8_t getGear() const
Returns the currently selected gear.
static String getGearString(int gear)
Returns a String that represents the given gear.
bool gearChanged() const
Checks whether the current gear has changed since the last update.