This is Lua 5.1.5 with the following patches:
-
This is used in eLua and nodemcu
-
Original patch can be found here: https://github.com/TerryE/lua-5.1/commits/master
-
Changes to support printing to Serial and file loading from SdFat.
Compile in the Arduino IDE or change ARDUINO_DIR
in lua-teensy/Makefile
to
point to where the arduino ide is installed on your linux system.
make && make upload
sleep 2;
miniterm.py /dev/ttyACM0 115200
--- Miniterm on /dev/ttyACM0 115200,8,N,1 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
SD Card Init ...
SD Card Init Complete
=== Help =========================
SD Card functions:
sd.ls()
sd.cat("ram.lua")
sd.run()
RAM Usage:
print(collectgarbage'count')
Force garbage collection:
collectgarbage'collect'
Use EOT (Ctrl-D in miniterm.py) to exec code
>> print(math.sqrt(2))␄
1.4142135381699
>> print(collectgarbage'count')␄
5.8896484375
>>