77#include < HID.h>
88#include " ./lib/G27PedalsShifter.h"
99
10+ // comment either out to disable
11+ #define USE_PEDALS
12+ #define USE_SHIFTER
13+
1014// for debugging, gives serial output rather than working as a joystick
1115// #define DEBUG true
1216
9498#define OUTPUT_RED_RIGHT 18
9599
96100// SHIFTER AXIS THRESHOLDS
97- #define SHIFTER_XAXIS_12 295 // Gears 1,2
101+ #define SHIFTER_XAXIS_12 290 // Gears 1,2
98102#define SHIFTER_XAXIS_56 600 // Gears 5,6, R
99103#define SHIFTER_YAXIS_135 750 // Gears 1,3,5
100- #define SHIFTER_YAXIS_246 200 // Gears 2,4,6, R
104+ #define SHIFTER_YAXIS_246 290 // Gears 2,4,6, R
101105
102106// PEDAL AXIS THRESHOLDS
103107#define MIN_GAS 27
@@ -407,7 +411,7 @@ void loop() {
407411 describePedal (" GAS" , " X" , gasPedal);
408412 describePedal (" BRAKE" , " Y" , brakePedal);
409413 describePedal (" CLUTCH" , " Z" , clutchPedal);
410- #else
414+ #elif defined(USE_PEDALS)
411415 setXAxis (gasPedal);
412416 setYAxis (brakePedal);
413417 setZAxis (clutchPedal);
@@ -426,8 +430,11 @@ void loop() {
426430
427431#if defined(DEBUG_SHIFTER)
428432 describeButtonStates (buttonStates, shifterPosition, gear);
429- #else
433+ #elif defined(USE_SHIFTER)
430434 setButtonStates (buttonStates, gear);
435+ #endif
436+
437+ #if !defined(DEBUG_SHIFTER) || !defined(DEBUG_PEDALS)
431438 G27.sendState ();
432439#endif
433440
0 commit comments