-
1Mount Sliders
Mount the drawer sliders to the table 7.75 inches apart as shown. Make sure you screw the small side into the table, as the wheel can only clip onto the large side. For the back screws, allow them to stick up enough to prevent the second stage of the slider from moving.
Secure the potentiometers to the drawer sliders like in the image above. A 3D-printed component would probably be better here, but the command strips worked fine for me (there isn't much force trying to separate them from the table). This is where you can also attach the magnets if you want a back detent. I just used tape. Open the brackets on the steering wheel and clip it to the large sides of the drawer sliders as shown. This should secure it to the sliders, while still allowing it to yaw.
-
2Wire
Wire as follows:
Both potentiometers Pin 1: 5v
Both potentiometers Pin 3: ground
Left potentiometer Pin 2: A0
Right potentiometer Pin 2: A3.
Note that they have two channels, and all three wires have to connect to the same channel in order for them to register properly.
-
3Program
Add the library https://github.com/MHeironimus/ArduinoJoystickLibrary to your Arduino environment. Load the following code onto the Arduino (adapted from the excellent article at https://giovannimedici.wordpress.com/2020/10/11/ch-pro-pedals-gameport-to-usb-adapter/ ):
#include "Joystick.h" Joystick_ Joystick(JOYSTICK_DEFAULT_REPORT_ID, JOYSTICK_TYPE_JOYSTICK, 0, 0, false, false, false, true, true, false, false, false, false, false, false ); void setup() { pinMode(A0, INPUT); pinMode(A3, INPUT); Joystick.begin(false); } void loop() { int leftPot = analogRead(A0); int rightPot = analogRead(A3); Joystick.setRxAxis(leftPot - rightPot + 512); Joystick.setRyAxis(leftPot/2 + rightPot / 2); Joystick.sendState(); delay(20); }
Once the code is loaded, you should see a new game controller. Open game controller settings, right-click on Sparkfun Pro Micro (or whatever yours is called), and then Properties->Settings->Calibrate. Follow the onscreen instructions to calibrate the new axes. You're done! Any game that supports controllers should allow you to use the new axes.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.