Skip to content

Commit eb30693

Browse files
committed
Add unused detect pin to shifter examples
Matches the layout of the G25 and G27 examples, and shows the user that this feature is available even if it requires extra hardware.
1 parent c5414b5 commit eb30693

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

examples/Shifter/LogitechShifter/LogitechShifter_Joystick/LogitechShifter_Joystick.ino

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,15 @@ const int Pin_ShifterX = A0; // DE-9 pin 4
4848
const int Pin_ShifterY = A2; // DE-9 pin 8
4949
const int Pin_ShifterRev = 2; // DE-9 pin 2
5050

51-
SimRacing::LogitechShifter shifter(Pin_ShifterX, Pin_ShifterY, Pin_ShifterRev);
51+
// This pin requires an extra resistor! If you have made the proper
52+
// connections, change the pin number to the one you're using
53+
const int Pin_ShifterDetect = SimRacing::UnusedPin; // DE-9 pin 7, requires pull-down resistor
54+
55+
SimRacing::LogitechShifter shifter(
56+
Pin_ShifterX, Pin_ShifterY,
57+
Pin_ShifterRev,
58+
Pin_ShifterDetect
59+
);
5260
//SimRacing::LogitechShifter shifter = SimRacing::CreateShieldObject<SimRacing::LogitechShifter, 2>();
5361

5462
const int Gears[] = { 1, 2, 3, 4, 5, 6, -1 };

examples/Shifter/LogitechShifter/LogitechShifter_Print/LogitechShifter_Print.ino

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,15 @@ const int Pin_ShifterX = A0; // DE-9 pin 4
3535
const int Pin_ShifterY = A2; // DE-9 pin 8
3636
const int Pin_ShifterRev = 2; // DE-9 pin 2
3737

38-
SimRacing::LogitechShifter shifter(Pin_ShifterX, Pin_ShifterY, Pin_ShifterRev);
38+
// This pin requires an extra resistor! If you have made the proper
39+
// connections, change the pin number to the one you're using
40+
const int Pin_ShifterDetect = SimRacing::UnusedPin; // DE-9 pin 7, requires pull-down resistor
41+
42+
SimRacing::LogitechShifter shifter(
43+
Pin_ShifterX, Pin_ShifterY,
44+
Pin_ShifterRev,
45+
Pin_ShifterDetect
46+
);
3947
//SimRacing::LogitechShifter shifter = SimRacing::CreateShieldObject<SimRacing::LogitechShifter, 2>();
4048

4149
const unsigned long PrintSpeed = 1500; // ms

0 commit comments

Comments
 (0)