A couple of weeks ago I was trying to find a way to determine if an RC receiver is receiving a signal or not. Pulsin didn't work because no signal seems to be different from zero pulse.
I put my DVM on the an output pin in the receiver and noted that the voltage read as zero when it was receiving no signal, and 0.2v when it had a signal. By trial and error I got the following code to work ... after a fashion: The LED comes on if the receiver is receiving a signal from its transmitter, and off if it isn't.
But initially I had used ... if b13< 3 then ... and it didn't work Why should that be? If I instruct it to do something if the value is greater than 3, then it should also work if I change the instruction to less than 3, shouldn't it? But it doesn't -- the led stays on whether the receiver is getting a signal or not
Also, I don't understand why a value of 3 works when I had measured 0.2 with my DVM on dc volts setting. If I use 4 the led stays on all the time. Am I not right in thinking that "256 different analogue readings ... over the full voltage range (e.g. 0 to 5V)" means that with a 5v input, 0.2v on pin 1 should result in a readadc value of about 10?
I put my DVM on the an output pin in the receiver and noted that the voltage read as zero when it was receiving no signal, and 0.2v when it had a signal. By trial and error I got the following code to work ... after a fashion: The LED comes on if the receiver is receiving a signal from its transmitter, and off if it isn't.
Code:
main:
loop: readadc 1,b13
if b13> 3 then led_on
goto led_off
led_on: high 4
goto loop
led_off: low 4
goto loop
Also, I don't understand why a value of 3 works when I had measured 0.2 with my DVM on dc volts setting. If I use 4 the led stays on all the time. Am I not right in thinking that "256 different analogue readings ... over the full voltage range (e.g. 0 to 5V)" means that with a 5v input, 0.2v on pin 1 should result in a readadc value of about 10?