This is a collection of simple python scripts to provide easy cross-platform access to a Lego Mindstorms NXT robot running the modified firmware pbLua.
-
Make sure to have a flashed NXT brick running pbLua connected to your computer via USB (at the moment Bluetooth is not supported). Therefore follow the instructions provided in the pbLua repository.
-
In order to communicate with the brick make sure to have the respective drivers installed.
-
For macOS and Windows official Lego NXT Fantom drivers are available.
-
On Linux the package libusb is needed.
-
sudo apt-get install libusb
- The provided scripts were written in Python 3. So please check if python already lives on your system.
python3 --version
If the output looks something like Python 3.x.x, you're good to go. Otherwise you'll need to install Python. There are official downloads with setup instructions available on their website.
Users on Unix-like systems are lucky, as they can use a package-manager instead to install Python.
Linux
sudo apt-get install python3
macOS
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install python3
The main script run.py is a wrapper for all other scripts and functions in this repository. It can be used to establish a connection with your brick, transmit a lua script, run it and show you any results.
There is an easy shorthand command that takes care of everything.
./run.py your_cool_script.lua
./run.py -r