From dfe1f6fe4ccfe0446cbe39298c8fccd99fce60e8 Mon Sep 17 00:00:00 2001 From: Jason Duncan Date: Tue, 31 May 2016 09:03:35 -0400 Subject: [PATCH] Added an option to invert the brake axis. --- G27_Pedals_and_Shifter.ino | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/G27_Pedals_and_Shifter.ino b/G27_Pedals_and_Shifter.ino index 608a686..7c8aa73 100644 --- a/G27_Pedals_and_Shifter.ino +++ b/G27_Pedals_and_Shifter.ino @@ -21,8 +21,11 @@ // red for brake, green for gas, blue for clutch //#define PEDAL_COLORS true +// for load-cell users and Australians +//#define INVERT_BRAKE true + // use static thresholds rather than on-the-fly calibration -#define STATIC_THRESHOLDS true +//#define STATIC_THRESHOLDS true // LED PINS #define RED_PIN 3 @@ -395,6 +398,11 @@ void loop() { processPedal(brakePedal); processPedal(clutchPedal); +#if defined(INVERT_BRAKE) + Pedal* brake = (Pedal*)brakePedal; + brake->axis = map(brake->axis, 0, MAX_AXIS, MAX_AXIS, 0); +#endif + #if defined(DEBUG_PEDALS) describePedal("GAS", "X", gasPedal); describePedal("BRAKE", "Y", brakePedal);