1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 04:52:59 +01:00
RIOT/examples/lua_REPL
Gaëtan Harter 1ab5a9390d
boards/slwstk6000b-*: split one board for each module
Define one board for each of the available modules.
2019-10-08 16:33:27 +02:00
..
main.c examples/lua_REPL: cast pointer to void in printf 2018-08-03 11:03:59 +02:00
Makefile boards/slwstk6000b-*: split one board for each module 2019-10-08 16:33:27 +02:00
README.md
repl.lua

Lua interactive interpreter

About

This example shows how to run a Lua Read-Eval-Print loop. It works in a similar way to the lua shell that comes with your operating system's default lua installation.

How to run

Type make all flash to program your board. The lua interpreter communicates via UART (like the shell).

It is not recommended to use make term because the default RIOT terminal messes up the input and output and the REPL needs multi-line input. Instead, use something like miniterm.py from pyserial:

miniterm.py --eol LF --echo /dev/ttyACM0 115200

By default only some of the builtin modules are loaded, to preserve RAM. See the definition of BARE_MINIMUM_MODS in main.c.

Using the interpreter

See the Lua manual for the syntax of the language.

Each piece of single or multi-line input is compiled as a chunk and run. For this reason, issuing "local" definitions may not work as expected: the definitions will be local to that chunk only.