Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
18 lines (13 sloc) 362 Bytes
pin = 2
pinVal = 1
gpio.mode(pin, gpio.OUTPUT)
counter = 0
timer = tmr.create()
timer:register(1000, tmr.ALARM_AUTO,
function (t)
gpio.write(pin, pinVal)
print ("Wrote to D" .. pin .. " value " .. pinVal)
pinVal = 1-pinVal; counter = counter + 1
if counter == 10 then t:stop(); t:unregister() end
end)
timer:start()
You can’t perform that action at this time.