No Description

init.lua 208B

123456789101112
  1. lighton=0
  2. pin =4
  3. gpio.mode(pin,gpio.OUTPUT)
  4. tmr.alarm(1,200,1,function()
  5. if lighton==0 then
  6. lighton=1
  7. gpio.write(pin,gpio.HIGH)
  8. else
  9. lighton=0
  10. gpio.write(pin,gpio.LOW)
  11. end
  12. end)