How to read PWM from Rx with Arduino UNO?

Hi all, very sorry if this has been answered elsewhere, but I've spent several hours searching this site and the web in general and have not found a great answer.

 

I'd like to read the PWM servo signals coming out of my receiver (Spektrum Ar600) with an Arduino UNO board and mirror them back out to the servo (so I can eventually add some control in the future). Creating PWM signals with the Arduino appears straight forward, but reading them has not been so obvious.

I've found instructions on doing this with pulseIn but it appears from what I've read that that's a slow method and limited to only 2-3 channels.  I've also seen a lot of discussion regarding using interupts to do this but haven't found any good explanation or code on how I can implement.  Any links to help/example code would be greatly appreciated!

Thanks 

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Hello,

    I am implementing reading PWM on arduino mega by interupt by the signal is not perfect, i am wondering if this "noise" some from software signal or hardware? (see attached image)

    Do you have the same noise?

    In the image nomovement i don't move the radio, in the image MinMaxMovement i move the radio to min and max.

    Due to this error i have more error in my PID :-(

    Ghis

    noMovement.PNG

    MimMaxMovement.PNG

    https://storage.ning.com/topology/rest/1.0/file/get/3692445005?profile=original
  • 3D Robotics
    The simplest example we have in in our Blimpduino code. Check the RC tab:

    http://code.google.com/p/blimpduino/downloads/list
This reply was deleted.

Activity

David Hori liked Isabella Domi's profile
Jan 12
gotham liked gotham's profile
Dec 3, 2020
More…