- Basic- All button mapping
- Version 1.0- Direction and speed control
- Version 2.0- Exception handling
Updating Raspberry Pi:
apt-get update && apt-get upgrade -y-
For bluetooth controllers:
sudo bluetoothctl power on agent on default-agent
The bluetoothctl will keep the bluetooth device talking to Linux.
scan on
This gives a list of the avaiable devices
pair XX:XX:XX:XX:XX:XX
This is the format for pairing the device with the device ID.
-
For USB Controllers:
Just plug in the USB cable
Turn off/unplug the device and use
ls /dev/inputThen reconnect/plug the device back in and run the command again.
This gives the new device that is being added. For eg, Device1
Now to test out out the incoming data from the device:
cat /dev/input/Device1if this gives an output it means the device is connected and it is communicating with the Raspberry Pi.
First, lets install EVDEV
sudo apt-get install python-dev
sudo apt-get install python-pip
sudo pip install evdevFirst, lets install input
pip install inputsor
git clone https://github.com/zeth/inputs.git
cd inputs
python setup.py installor just download inputs.py
- EVDEV
Parts: ecode type, event code, event value. - Inputs
Parts: event type, event code, event state.
sudo apt install -y mosquitto mosquitto-clients
mosquitto -vsudo apt-get update
sudo apt-get upgrade
sudo apt-get install python-pip python-flask
pi@raspberrypi ~ $ sudo pip install flasksudo pip install paho-mqtt- Highlighted fields are executable terminal commands.
- Flask as backup if controller fails