Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- gpio.mode(5, gpio.INPUT)
- doortime = 0
- function dooralert(level)
- if(doortime + 5 < tmr.time()) then
- doortime = tmr.time()
- print("doorbell")
- conn=net.createConnection(net.TCP, 0)
- conn:on("receive", function(conn, pl) print(pl) end) --not really needed, remove after testing
- conn:connect(80,"<REMOVED>")
- conn:send("GET <REMOVED> HTTP/1.1\r\nHost: <REMOVED>\r\n Connection: keep-alive\r\nAccept: */*\r\n\r\n")
- conn=nil
- end
- end
- gpio.trig(5, "up", dooralert)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement