Skip to content

Instantly share code, notes, and snippets.

@RuiSantosdotme
Created May 24, 2015 09:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RuiSantosdotme/6048a62eaf58a0e70ea8 to your computer and use it in GitHub Desktop.
Save RuiSantosdotme/6048a62eaf58a0e70ea8 to your computer and use it in GitHub Desktop.
lighton=0
pin=4
gpio.mode(pin,gpio.OUTPUT)
tmr.alarm(1,2000,1,function()
if lighton==0 then
lighton=1
gpio.write(pin,gpio.HIGH)
else
lighton=0
gpio.write(pin,gpio.LOW)
end
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment