Hi!
For the last 15 years, Iv'e been wanting to build an RC-car with all the fancy lights, braking, reverse, blinker etc.
Iv'e taken a small Kyosho Mini-Z Overland truck and installed a plethora of LED's, this was done 10 years ago.
Not until now that Iv'e discovered Arduino, is it getting close to realization.
I've managed to read the TTL input from a standard RC reciever, with the 1-2 ms pulses signifying turning left or rigth etc.
This small model however, does not have those. It has a all-in-one 27Mhz AM reciever with motor driver and steering servo driver in it. The only signal Iv'e found is from somewhere within the radio reciever. It comes as a 3-4 volt PWM signal (See pic). It seems to come with 3 pulses after another and its the low period that means something. When I turn the knobs of the RC control, the low periods increase or decrease, but the high periods remain constant and is moved right or left. First channel one, then channel two, then another long period of low.
How can I read this and get measurements of the pulses' lenght, in microseconds?
I figured I'd use the AD1 input on my Arduino Uno and did something like this: (This is in Pseudocode, I know)
while (input > 10){} //wait here until low pulse starts
start = micros();
while (input < 10){} //wait for pulse to finish
timeA = start - micros(); //get reading for low period A.
while (input > 10){} //wait here until low pulse starts
start = micros();
while (input < 10){} //wait for pulse to finish
timeB = start - micros(); //get reading for low period B.
while (input > 10){} //wait here until low pulse starts
start = micros();
while (input < 10){} //wait for pulse to finish
timeC = start - micros(); //get reading for low period C.
lcd.out(timeA);
lcd.out("+");
lcd.out(timeB);
lcd.out("+");
lcd.out(timeC);
timeA, timeB, TimeC=0;
delay(1000);
loop...
This gives me printouts on my LCD-shield like this:
I'm getting wierd results.
Reasonable numbers? Maybe, bit not really. Also they seem constans. Sometimes "10200" changes to "10176" or so, but nothing seems to be changing by me changing the controls. I should be getting variations when I turn the knobs on the RC control.
Any ideas? Am I thinking correctly? Is this feasible?
