Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on = "sudo sh /home/pi/on"
- off = "sudo sh /home/pi/off"
- local old_s = redstone.getInput("left")
- while true do
- s = redstone.getInput("left")
- if s ~= old_s then
- old_s = s
- if s == true then
- http.post(
- "http://raspberrypi/mail/mail.php",
- "message="..textutils.urlEncode(tostring(on))
- )
- else
- http.post(
- "http://raspberrypi/mail/mail.php",
- "message="..textutils.urlEncode(tostring(off))
- )
- end
- redstone.setOutput("right", s)
- end
- sleep(0.5)
- end
Add Comment
Please, Sign In to add comment