Prerequisites

  1. Plug the controller into the Pi (USB cable or paired Bluetooth dongle).
  2. In your code (bundle/controller.py and/or TARSmaster.py), note the default event path (/dev/input/event3) or the auto-detection logic.

Install tools

sudo apt update
sudo apt install -y evtest joystick

Identify the event device

  1. List input devices: ls /dev/input/event*
  2. Run evtest on each candidate until you see button activity: sudo evtest /dev/input/eventX Press a few buttons—if you see the corresponding key codes, note the event ID.

Update the code

Test

cd ~/TARS-files/bundle
python3 controller.py

Press A/B/X/Y. You should see movement logs (“move forward”, “turn left/right”, etc.).

Troubleshooting