7
7
#include < HID.h>
8
8
#include " ./lib/G27PedalsShifter.h"
9
9
10
+ // comment either out to disable
11
+ #define USE_PEDALS
12
+ #define USE_SHIFTER
13
+
10
14
// for debugging, gives serial output rather than working as a joystick
11
15
// #define DEBUG true
12
16
94
98
#define OUTPUT_RED_RIGHT 18
95
99
96
100
// SHIFTER AXIS THRESHOLDS
97
- #define SHIFTER_XAXIS_12 295 // Gears 1,2
101
+ #define SHIFTER_XAXIS_12 290 // Gears 1,2
98
102
#define SHIFTER_XAXIS_56 600 // Gears 5,6, R
99
103
#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
101
105
102
106
// PEDAL AXIS THRESHOLDS
103
107
#define MIN_GAS 27
@@ -407,7 +411,7 @@ void loop() {
407
411
describePedal (" GAS" , " X" , gasPedal);
408
412
describePedal (" BRAKE" , " Y" , brakePedal);
409
413
describePedal (" CLUTCH" , " Z" , clutchPedal);
410
- #else
414
+ #elif defined(USE_PEDALS)
411
415
setXAxis (gasPedal);
412
416
setYAxis (brakePedal);
413
417
setZAxis (clutchPedal);
@@ -426,8 +430,11 @@ void loop() {
426
430
427
431
#if defined(DEBUG_SHIFTER)
428
432
describeButtonStates (buttonStates, shifterPosition, gear);
429
- #else
433
+ #elif defined(USE_SHIFTER)
430
434
setButtonStates (buttonStates, gear);
435
+ #endif
436
+
437
+ #if !defined(DEBUG_SHIFTER) || !defined(DEBUG_PEDALS)
431
438
G27.sendState ();
432
439
#endif
433
440
0 commit comments