1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/examples/lua_REPL
Marian Buschsieweke d2a3ff3d83
boards/{bluepill*,blackpill*}: rename and improve doc
- renamed:
    - `bluepill` --> `bluepill-stm32f103c8`
    - `bluepill-128kib` --> `bluepill-stm32f103cb`
    - `blackpill` --> `blackpill-stm32f103c8`
    - `blackpill-128kib` --> `blackpill-stm32f103cb`
- doc:
    - added link to corresponding hardware page on the STM32-base
      project
    - added picture
2023-01-02 16:23:10 +01:00
..
app.config.test examples: tests: lua: add Kconfig configuration 2022-04-27 11:12:27 +02:00
main.c treewide: Remove excessive newlines 2021-08-13 19:50:38 +02:00
Makefile examples/lua*: adapt to the blob mechanism 2020-06-23 08:45:20 +02:00
Makefile.ci boards/{bluepill*,blackpill*}: rename and improve doc 2023-01-02 16:23:10 +01:00
README.md examples/lua: Add REPL. 2018-07-02 15:39:31 +02:00
repl.lua examples/lua: Add REPL. 2018-07-02 15:39:31 +02:00

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.