This project demonstrates how to create a touch-sensitive steering wheel using the Trill Bar sensor and the Arduino Joystick library. The steering input is read from the Trill sensor and mapped to the steering axis of a virtual joystick, allowing you to control steering in a game or application by touching different positions on the Trill Bar.
- Arduino-compatible microcontroller based on ATmega32u4 (See list of supported boards for Joystick library here)
- Trill Bar sensor
- USB cable for programming and power
- Download the latest version of the Joystick library from this link.
- Open the Arduino IDE.
- Go to
Sketch>Include Library>Add .ZIP Library.... - Select the downloaded ZIP file and click
Open. The Joystick library's examples will now appear underFile>Examples>Joystick.
- Open the Arduino IDE.
- Go to
Sketch>Include Library>Manage Libraries.... - Search for "Trill" and install the Trill library by BelaPlatform.
Alternatively, you can download the library from this link and install it using the same steps as for the Joystick library.
- Microcontroller: SparkFun Qwiic Pro Micro - USB-C (ATmega32U4)
- Connection Cable: SparkFun Qwiic Cable - 50mm
- Sensor: Trill Bar
- Power and Programming: USB-C cable
For a neat setup, you can 3D print a housing for the Trill Bar using this Trill_Bar_Stand.stl from Thingiverse.
- Connect the Trill Bar to the SparkFun Qwiic Pro Micro using the SparkFun Qwiic Cable.
- Connect the SparkFun Qwiic Pro Micro to your computer using a USB-C cable.
When setting up the SparkFun Qwiic Pro Micro in the Arduino IDE, follow these steps carefully to avoid common pitfalls:
- Board Add-Ons: Install the Spark Fun board add-ons to Arduino IDE by following the instructions here.
- Board Selection: In the Arduino IDE, go to
Tools>Boardand selectSparkFun Pro Micro. - Processor Selection: Go to
Tools>Processorand selectATmega32U4 (5V, 16 MHz).
- Connect the Trill Bar sensor to your Arduino according to the Trill documentation.
- Open the Arduino IDE and create a new sketch.
- Copy and paste the provided code into the sketch.
- Compile and upload the sketch to your Arduino.
- (Optionally) open a serial monitor to observe the debug messages.
- The joystick should now respond to touches on the Trill Bar.