Someone prupose me this code but it's no work :
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
Interrupt(1) --executes the programm every second
if (event.type == "on" and event.pin.name == "A") then --if signal at A
port.b = true --start counting and show it
elseif (event.type == "interrupt" and port.b) then
if (not mem.counter) then
mem.counter = 0 --init
end
if (mem.counter == 120) then --if reaching 120 seconds
port.b = false --stop counter
port.c = true --send final signal
else
mem.counter = mem.counter + 1 --count up
end
end
Does someone know more than me about codding and can tell me the right code ( if it's possible)
Thank you