Programming the NXT with pbLua

pbLua was the 2nd tool I used to program the NXT.

It is very different to e.g. projects/Lego/nxc. You don't need to compile your scripts, nor do you upload them to the NXT. Instead you open a terminal and connect to your brick, which has been previusly flashed with the pbLua firmware, and start typing lua code as if it were in a local interactive lua shell. The code gets interpreted on the NXT and controlls your NXT.

There are ways to store scripts on the NXT and have them run when the brick is started. More about that later.

Getting started

First you need to download the latest pbLua firmware. See the prerequisites site for details on how to flash the firmware.

Once the new firmware is running, connect your NXT to your machine using USB. Then open a terminal e.g.:

screen /dev/ttyACM0

/dev/ttyACM0 may need to be replaced with the correct one your NXT is connected to.

If all has worked correctly, you should see the interactive lua shell:

pbLua Beta 14h
>

Now you can start typing in your code.

See the pbLua - examples.