Let me start off by saying that I am fully aware that there are other solutions to this problem that do not involve making a custom joystick, but I wanted to make a custom joystick so here we are.
This project is going to be of limited use to most people in it’s current form as it is designed for a very specific use case. That said it may be a useful starting point for somone wanting to create their own custom controller.
Materials:
Prerequisites:
Electrical connections:
I am going to paint you a word picture here because I didn’t take a picture before I added silicone for vibration/strain relief.
- Any GND pin on the arduino is connected to one side of both buttons.
- The other side of Button 1 (Dimmer) is connected to Pin 2.
- The other side of Button 2 (Brighter) is connected to Pin 3.
Implementation:
See the GitHub repo for the code. The implementation here is pretty simple and uses two primary libraries:
This results in a QGroundControl compatible controller with two buttons that map to buttons 13 (Dimmer) and 14 (Brighter).
Here is a video of the controller in action:
One stumbling block was the controller calibration. I ended up making a long-press key combo to enter calibration mode. Here you can fake a calibration by stepping through fake stick inputs.