LEGO Boost Robot in Python
- Raspberry Pi (1/2) and USB Bluethooth
- Raspberry Pi (3/4)
Using Windows is not recommended, because Bluetooth access from Python does not seem to be reliable abd GPIO will not be available.
The Python scripts should run in any Python 3 environment, but for GPIO functionality, a Raspi (Raspberry Pi 2/3/4) is required.
Also the comminucation with the LEGO hub is done using Bluetooth Low Energy (BLE) and I was only able to get a connection using Linux and a USB-Bluetooth stick.
Raspberry Pi 3/4 have Bluetooth built in and will not require any further USB stick.
Python ist installed on Raspi already. It is recommended to use Python 3 and virtual-environments to install any dependencies.
venv is not installed by default and should be installed with this command:
sudo apt install python3-venv
python3 -m venv .venv
You will need to install these Python dependencies:
pip3 install pyserial
Robot in action:
All sourcecode is available on Github: