Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #2
- function reset()
- port.d = false
- port.c = false
- port.a = false
- interrupt(0.01, "play")
- end
- function play()
- t = mem.msg
- if(t ~= nil) then
- for i=1, #t do
- if(t[i] == 100) then
- port.d = not port.d
- elseif(t[i] == 101) then
- port.c = not port.c
- elseif(t[i] == 102) then
- port.a = not port.a
- end
- end
- end
- mem.msg = {}
- end
- if(event.type == "digiline" and event.channel == "ch_def") then
- mem.msg = event.msg
- reset()
- elseif(event.iid == "play") then
- play()
- end
Add Comment
Please, Sign In to add comment