Game Controller Using a Custom Teensy (4.1) Joystick Interface

This is my first Teensy project (and also my first proper Arduino project), so let's just start by saying I had absolutely no idea what I was doing. There were some learning curves along the way, some of them were steeper than others, but I got there in the end - thanks to a little help from the forum and the fairly decent Teensy documentation and code comments etc. So thanks to everyone involved in making such a wonderfully powerful and versatile component with a helpful online community, Kudos to you.

So on to the project. I was in the process of assembling a hybrid Sim Rig at home with a focus on racing and space simulation. I already had the typical HOTAS, racing wheelbase and pedals etc. as well as a custom made RaspberryPi powered touchscreen dashboard, but I also wanted a button box. So I set about designing and making what I've called the 'Sim Rig Button Box'.

It's built around a Teensy 4.1 and has the following features:
  • 13x momentary buttons - 3x of which are located on a separate side button box
  • 03x toggle switches
  • 16x switches via 2x 8-way rotary switches - utilising edge detection
  • 03x Axis
    • X, Y axis controlled via 2x rotary encoders
    • Z axis via an analog input (hall sensor)
  • 02x additional rear buttons - for future use, change modes (rgb control, fan override speed etc.)
  • WS2812 LEDs for backlighting
  • 02x PWM controlled fans - for wind simulation purposes
I created a new Teensy USB type within the Arduino IDE with a custom joystick interface and custom descriptor so I only have the HID devices that I needed. If anyone is interested I can put together some documentation on how I achieved this.

The whole thing is assembled in a 3d printed enclosure and includes a custom designed profesionally manufactured PCB to house all of the various headers, connectors, inputs and outputs etc. All the external components connect to the button box using RJ12 6P6C connectors. The stickers around the rotary switchers, encoders and the two toggle switches, as well as the labels on the back of the box were home-made using a Cricut hobby machine.