This repository is attached to my Lego + Raspberry Pi + Xbox Controller project.
- Read the full article on my blog.
- Watch it in action on YouTube.
Main script to execute the RC car controller.
Reads Event
objects from the Xbox controller, and updates the GPIO/I2C outputs on the Raspberry Pi as appropriate.
Wrapper around xboxdrv
driver. Reads from the controller and emits Event
objects, which have a key
(A
, X1
, or other controller button) and a value
(0
or 1
for buttons. 0
to 256
for triggers. -32767
to 32768
for thumbsticks.
sudo apt-get install python-pip
sudo easy_install -U distribute
sudo apt-get install python-dev
sudo pip install RPi.GPIO
sudo apt-get install python-smbus
sudo apt-get install i2c-tools
sudo modprobe i2c-bcm2708
sudo modprobe i2c-dev
sudo apt-get install xboxdrv
sudo xboxdrv --wid 0 -l 2 --dpad-as-button --deadzone 12000
sudo ./lego-controller.sh