mirror of
https://git.mirrors.martin98.com/https://github.com/luc-github/ESP3D.git
synced 2025-06-06 02:36:49 +08:00
21 lines
381 B
C++
21 lines
381 B
C++
#include <LuaWrapper.h>
|
|
|
|
LuaWrapper lua;
|
|
|
|
static int myFunction(lua_State *lua_state) {
|
|
(void*)lua_state;
|
|
Serial.println("Hi from my C function");
|
|
return 0;
|
|
}
|
|
|
|
void setup() {
|
|
Serial.begin(115200);
|
|
lua.Lua_register("myFunction", (const lua_CFunction) &myFunction);
|
|
String script = String("myFunction()");
|
|
Serial.println(lua.Lua_dostring(&script));
|
|
}
|
|
|
|
void loop() {
|
|
|
|
}
|