Re: Timer.Start issue
Posted: Fri Dec 21, 2018 1:50 am
IOsens wrote:This does not seem to the right forum
Not sure, the (sub)title of the forum is "Post your best Lua script examples here".
-->
Open Community Forum for ESP8266, Come share Arduino and IoT (Internet of Things)
https://www.esp8266.com/
IOsens wrote:This does not seem to the right forum
dly = 500
ledPin = 4
gpio.mode(ledPin,gpio.OUTPUT)
ledState = 0
tmr.alarm( 0, dly, 1, function()
ledState = 1 - ledState;
gpio.write(ledPin, ledState)
print(ledState)
-- tmr.stop(0)
end)
tmr.stop(0)
tmr.start(0)
tmr.alarm( 0, dly, 2, function() ....
mytimer = tmr.create()
mytimer:register(5000, tmr.ALARM_SINGLE, function()
print("hey there")
end)
mytimer:start()
IOsens wrote:-> attempt to call field 'create' (a nil value)