Lua from within the Arduino Development Environment
Posted: Wed Nov 27, 2019 1:18 pm
This Arduino library provides the lua 5.3.5 ( release ) scripting engine for ESP8266/ESP32 sketches. This allows dynamic execution of Lua code on the Arduino without having to compile and flash a new firmware.
https://github.com/sfranzyshen/ESP-Arduino-Lua
Arduino IDE Library example: HelloWorld.ino
ESP8266
ESP32
https://github.com/sfranzyshen/ESP-Arduino-Lua
Arduino IDE Library example: HelloWorld.ino
Code: Select all
#include <LuaWrapper.h>
LuaWrapper lua;
void setup() {
Serial.begin(115200);
String script = String("print('Hello world!')");
Serial.println(lua.Lua_dostring(&script));
}
void loop() {
}
ESP8266
Code: Select all
Sketch uses 327776 bytes (31%) of program storage space. Maximum is 1044464 bytes. Global variables use 31276 bytes (38%) of dynamic memory, leaving 50644 bytes for local variables. Maximum is 81920 bytes.
ESP32
Code: Select all
Sketch uses 310749 bytes (23%) of program storage space. Maximum is 1310720 bytes. Global variables use 15388 bytes (4%) of dynamic memory, leaving 312292 bytes for local variables. Maximum is 327680 bytes.