The LEGO® Boost kit is all about delivering a simplified route into robotics.
You can create models using standard LEGO® bricks. And there's an easy-to-get-started block-based coding app for iOS and Android.
The kit's Move Hub accepts a real-time stream of code instructions, sent via bluetooth, to interact with the built-in motors, LEDs and sensors.
However, it's also possible to interact with the Move Hub using Python, a far more flexible alternative block-based coding.
First you'll need a Python installation on your PC, Mac or Raspberry Pi 3B/3B+/3A+ or Zero W.
You'll also have to install some dependencies:
sudo apt-get install python3-pip
sudo pip3 install pexpect
sudo pip3 install pygatt
Then install the LEGO® Boost Python library module:
wget https://github.com/undera/pylgbst/archive/master.zip
unzip master.zip
cd pylgbst-master
sudo python3 setup.py install
To find out more on using Python with LEGO® Boost (and get to access to plenty of code samples) check out the series of articles by Mike Cook in the official Raspberry Pi magazine, starting at issue 80.
And read my More LEGO® Boost Python Coding post for additional inspiration.
No comments:
Post a Comment