Re: [NodeMcu] Lua script examples
Posted: Sat Nov 22, 2014 1:12 pm
2AM morning here. continue tomorrow
-->
Open Community Forum for ESP8266, Come share Arduino and IoT (Internet of Things)
https://www.esp8266.com/
zeroday wrote:2AM morning here. continue tomorrow
--myfile.lua
local myfile = {}
function myfile.print(name)
file.open(name)
repeat
local line=file.readline()
if line then line=(string.gsub(line,"\n","")) print(line) end
until not line
file.close()
end
return myfile
mf=require("myfile")
mf.print("init.lua")