Kevin Boone Brings a "Proof of Concept" Lua Programming Environment to the Raspberry Pi Pico

Project bundles a Lua run-time along with a rudimentary POSIX-style shell, full-screen editor, and file management — all on the RP2040.

Gareth Halfacree
3 years agoProductivity

The number of programming languages in which you can target the Raspberry Pi Pico's RP2040 microcontroller continues to grow, with developer Kevin Boone releasing a Lua programming environment for the device.

Launched earlier this year, the Raspberry Pi Pico and its RP2040 microcontroller — available for third-parties to use in their own board designs — has proven incredibly popular. The $4 board and its surprisingly-capable microcontroller have found a home in a range of projects, and the launch-day support for programming in C/C++ and MicroPython quickly expanded to include the blocks-based BIPES, Mecrisp-Stellaris Forth, and now Lua.

"Picolua is a proof-of-concept Lua programming environment for the [Raspberry] Pi Pico," Boone explains of the project, which was brought to our attention by Adafruit. "As well as the Lua run-time, it includes a rudimentary shell that accepts Linux-like commands, a full-screen editor, and basic file management facilities.

"Picolua is designed to be operated by connecting the Pico's USB to a terminal emulator. Lua functions have been added for controlling the Pico's GPIO and other peripherals. As a result, it is possible to enter and run simple programs that manipulate connected devices, without the need for any particular development tools. There is support for general digital input/output, analog input, PWM output, and I2C."

While Boone describes the project as a proof-of-concept, and its version number of 0.3 at the time of writing suggests it's not ready for prime-time, the Lua environment brings in most of the programming language's features - bar those designed to interact with an underlying operating system, not present on the Raspberry Pi Pico. Some features, however, are missing — likely permanently: "There is no support," Boone warns, "and probably never will be, for DMA, interrupts, threading, or multi-core operation."

More details, and a getting-started guide for those unfamiliar with Lua, can be found on the project's GitHub repository, along with the source code under a custom permissive license.

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles