Hi again all,
I would like to use a radio transmitter/receiver setup to detect whether a bike or other object has been moved out of range.
At the moment I am just sending a single bit of data from the transmitter every 100ms which keeps an LED lit but when I take the trnsmitter out of range I want the LED to switch off.
The problem as I see it is that the receiver code only reacts to info read in so when the transmitter is out of range the bit of info is not actually 0 but instead is nothing.
Any help please, my current code is below
***TRANSMIT***
main:
b0 = 1
serout 0, n2400, (85, 85, 85, "safe", b0)
pause 100
goto main
***RECEIVE***
main:
serin 3, n2400, ("safe"), b1
if b1 = 1 then safe
low 2
goto main
safe:
high 2
goto main
I would like to use a radio transmitter/receiver setup to detect whether a bike or other object has been moved out of range.
At the moment I am just sending a single bit of data from the transmitter every 100ms which keeps an LED lit but when I take the trnsmitter out of range I want the LED to switch off.
The problem as I see it is that the receiver code only reacts to info read in so when the transmitter is out of range the bit of info is not actually 0 but instead is nothing.
Any help please, my current code is below
***TRANSMIT***
main:
b0 = 1
serout 0, n2400, (85, 85, 85, "safe", b0)
pause 100
goto main
***RECEIVE***
main:
serin 3, n2400, ("safe"), b1
if b1 = 1 then safe
low 2
goto main
safe:
high 2
goto main