Remote Control

my project is to use remote control DX9 to coutrol a two wheel rebot.

in order to connect them i use a DSM2 receiver, four pins are connected from THRD,AIL,ELEV and RUDO to analoge pin A8A9A10A11 of ARDUINO MEGA.

however, when i want print the analoge output it always display number between 30 to 40 keep changing and remote control cannot control the number.

what should i do

transmitter_read.ino (1.03 KB)

Unless your code is longer than the forum will allow, which yours definitely is not, please always post it as text right in the thread using code tags (</> button on the toolbar). This will make it much easier for people to take a look at it and thus will give you a better chance at getting help with your problem.

I don’t see anything in your code that could cause the problem so it’s likely to be a problem with the transmitter, receiver, or wiring between the transmitter and Arduino. Do you have the grounds of your Arduino and receiver connected together?

my project is to use remote control DX9 to coutrol a two wheel rebot.

What is a rebot?

A link to the DX9 device would certainly be useful.

in order to connect them i use a DSM2 receiver

A link to the DSM2 device would certainly be useful.

I guess you're talking about a Spektrum DX9 RC transmitter. The output from a Spektrum DSM2 RC receiver is a servo pulse i.e. 1-2ms pulse repeated at approx 20ms intervals. You want to read that on a digital pin using some existing code like that described in https://www.sparkfun.com/tutorials/348

It's really straightforward using pulsein but it isn't an analog signal, which is why you're having trouble.

Steve

thank you very much. it's really helpful.