This is based on sotasystems' excellent code for turning a Leonardo pro micro controller into a gamepad for his PiBoy project. The teensy allows me to have some cooler functions, even if a teensy is a little overkill for this use case.
Features include :
- Joystick autocalibration from Sota's code (Just rotate the joysticks 360 degrees a couple of times and they are calibrated)
- Neopixel status led
- Teensy 3.x (This code was developed exclusively on a Teensy 3.2)
- Momentary or press switches to act as buttons
- Arduino IDE 1.8.x
- teensyduino add on for arduino IDE
- One or two Analog Joysticks (I used 2 of these)
- Bounce library (Comes with teensyduino)
This feature is heavily dependent on other hardware and scripts
- Adafruit Neopixel library (Comes with teensyduino)
- Adafruit neoPixel (I used a single 5mm through hole version);
- Powerboost 1000c with safe shutdown switch;
- Safe Shutdown PCB (PowerBoost Edition)
- [Safe shutdown script] based off Camble's (power monitor)[https://github.com/Camble/GBZ-Power-Monitor_PB] script;
// TODO
The original code can be found on this thread: http://www.sudomod.com/forum/viewtopic.php?f=22&t=1766