Hi,
I'm trying to add a timeout command to my code but it's not working correctly. My code is basically this:
Without the timeout, my code works perfectly, but when I add the timeout command, the PIC starts switching on the wrong outputs. Eg. If I send the PIC "020 002" by serial, it should switch on output 1, but with the timeout command added, it sometimes switches on output 1, sometimes output 0, sometimes both and sometimes a different output.
Please tell me what's going wrong here. Thankyou
I'm trying to add a timeout command to my code but it's not working correctly. My code is basically this:
Code:
main:
let b2 = 0
let b1 = 0
serrxd [1000,timeout],b2,b1
if b2 = 20 then led
goto main
led:
let pins = b1
goto main
timeout:
let pins = 0
low portc 1
low portc 0
goto main
Please tell me what's going wrong here. Thankyou