Go Down

Topic: Need help with RC and arduino (Read 875 times) previous topic - next topic

vizina13

I need some help, I have the uno and trying to hook up a rc controler to control servos, My initial set up with LED's was a failure. I got the code from the guy who built the lawnbot, he did a test using led's to see if it was working, one led would come on when the control stick was pressed forward, another would come on when the stick was pressed backwards, and the last one would come on when the stick was in the middle. 
I ran the same code and could not get anything to work for me. The signal wire from the reciever i hook up to pin 2 as an input from channel 1 from the reciever, an LED i hook up to pin 12 for an output. So when i push the control stick forward it should turn the led on and when i release it the led should go off.
What am i missing. Please can anyone help me out.
Thanks

retrolefty

What your missing is not posting your sketch (use the # code window) and a drawing of all your wiring. Without that all we can say is: "Hey kid, your not doing it right".  ;)

Lefty

DuaneB

Hi,
   You also do not indicate if you are using hobby quality of toy quality radio control systems. In the case of toy quality, the signal is on or off, in the case of hobby quality, its mostly empty space with short pulses, you would need very different code depending on which it is.

See here for details of hobby quality signals - http://rcarduino.blogspot.com/2012/01/how-to-read-rc-receiver-with.html

Duane B

rcarduino.blogspot.com
Read this
http://rcarduino.blogspot.com/2012/04/servo-problems-with-arduino-part-1.html
then watch this
http://rcarduino.blogspot.com/2012/04/servo-problems-part-2-demonstration.html

Rcarduino.blogspot.com

dxw00d

Take a look at this page: http://diydrones.com/profiles/blog/show?id=705844:BlogPost:38418

There is a sample sketch to download. It uses pulseIn() to read the receiver.

vizina13

no luck with the code from there,, all i get it two led lights blinking, no matter what i do with the stick they still blink.
is there just a code i can find that just test the led lights with the controller ? I'm new to all this and i look at diffrent threads and its overwhelming.

DuaneB

#5
Feb 21, 2012, 06:47 am Last Edit: Feb 21, 2012, 09:25 am by DuaneB Reason: 1
Hi,
   People have pointed you to good resources, however you do have to do some work yourself. Here are some pointers to get you going

1) If you use the code from here - http://rcarduino.blogspot.com/2012/01/how-to-read-rc-receiver-with.html

It should print the RC Input value to the serial monitor, have you done this ?

2) If yes to 1) after then after the line Serial.println(nThrottleIn);  you can add some code to turn one LED on if nThrottle in > 1500 and the other LED on if nThrottle in < 1500.

Over to you,

Duane B.

rcarduino.blogspot.com
Read this
http://rcarduino.blogspot.com/2012/04/servo-problems-with-arduino-part-1.html
then watch this
http://rcarduino.blogspot.com/2012/04/servo-problems-part-2-demonstration.html

Rcarduino.blogspot.com

Go Up