LEGO Boost and Python
Update: Simpler and newer version: LEGO Boost and Python - CentOS 7.
I've manage to control LEGO Boost using Python.
I've used CentOS 7, BLED112 dongle and pylgbst library.
There are a few command I have to run:
yum install rh-python36 /opt/rh/rh-python36/root/usr/bin/pip install pygatt /opt/rh/rh-python36/root/usr/bin/pip install https://github.com/undera/pylgbst/archive/0.9.tar.gz /opt/rh/rh-python36/root/usr/bin/pip install pexpect
now I can run first program (boost1.py):
from pylgbst.movehub import MoveHub hub = MoveHub() for device in hub.devices: print(device)
using command:
/opt/rh/rh-python36/root/usr/bin/python boost1.py 1 2 55 56 57 50 58 59 60
as you can see, there are list of devices IDs (1, 2, 55, 56, 57, 50, 58, 59, 60).
Let's try to do something (boost2.py):
from pylgbst.movehub import MoveHub, COLOR_RED hub = MoveHub() hub.led.set_color(COLOR_RED)
Yes! The LED has been changed to red.
Komentarze
Log in or create a user account to comment.