Project 4 - Hosting a USB Game Controller

Demo Video

Summary

In this project, you can see how to take full control of USB devices using your own Python scripts. This chapter provides an introduction to how USB devices work; a short tutorial on how to figure out what you need to do to receive input from USB devices; and example code that reads input from a USB game controller and sends it to an Arduino sketch to control a servo motor and some LEDs.

Parts List

  • An Arduino Yún, connected to your local network over Ethernet or Wi-Fi
  • A microSD card, with the OpenWrt-Yun file system expanded onto it
  • Four light-emitting diodes (LEDs)
  • Four 220 Ω resistors
  • One 3-pin, standard RC servo motor
  • A solderless breadboard and jumper wires
  • A USB game controller
    • Microsoft Xbox 360® wired controller
    • PC USB game controller (for example, a Thrustmaster® Firestorm Dual Power / Dual Analog 3)
    • Sony PlayStation® DualShock® 4 (PS4™ controller through a micro-USB cable)
    • Sony PlayStation® DualShock® 3 (PS3™ controller through a mini-USB cable)

Useful Links

Circuit Diagrams

Source Code Download Here

ArduinoMeetsLinux-P4.ino

Start Building Today

book cover Start Reading Now

Your guide to Yún developement. Arduino Meets Linux includes:

  • Over 320+ pages of content
  • OpenWrt-Yun Linux tutorials
  • Python and shell scripting
  • 7 in-depth Arduino projects

Take your Arduino projects to the next level. This book shows you how.