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

DIY Robocars via Twitter
RT @chr1sa: The monthly @diyrobocars virtual race is starting now! https://www.twitch.tv/roboticists2
6 hours ago
Mike Whitney liked Mike Whitney's profile
Jul 19
DIY Robocars via Twitter
Jul 2
DIY Robocars via Twitter
Jun 26
Abdulatif Tlaib liked Ryan's profile
Jun 24
DIY Robocars via Twitter
RT @SmallpixelCar: First time at @wsraceways. After tuning @HokuyoUsa lidar signal and camera sensor on @NVIDIAEmbedded, my car was able to…
Jun 20
DIY Robocars via Twitter
RT @breadcentric: The handy bit about racing with self-driving cars is that one can type while the car is racing. Report from #AWSDeepRacer…
Jun 18
DIY Robocars via Twitter
RT @chr1sa: Our Bay Area @DIYRobocars meetup is now at 2,700 members. Next in-person events (in Oakland) are training day on July 17 and…
Jun 18
DIY Robocars via Twitter
Videos from the ICRA autonomous racing workshop are now available: https://linklab-uva.github.io/icra-autonomous-racing/
Jun 10
DIY Robocars via Twitter
RT @SmallpixelCar: Prepared race track for Warm Spring Raceways @wsraceways and looking forward to test my new car at RAMS RC @ramsaicar fa…
Jun 6
DIY Robocars via Twitter
RT @f1tenth: Trying out some nasty blocking maneuvers 🏎️🤖 #f1tenth #autonomousracing https://t.co/nMTstsaogM
Jun 5
DIY Robocars via Twitter
May 27
DIY Robocars via Twitter
RT @araffin2: I will talk this Saturday from 18:00 to 19:00 Paris time for the @diyrobocars community about learning to race in hours using…
May 27
DIY Robocars via Twitter
RT @a1k0n: Luckily the infeasible hairpin problem was easily reproducible in simulation and I could test the fix before bringing the car ba…
May 26
DIY Robocars via Twitter
RT @a1k0n: Another problem was that I was over-constraining the car's allowed accelerations, so it didn't think it could turn as tight as i…
May 26
DIY Robocars via Twitter
RT @a1k0n: Breaking the map up into two halves worked, but I had to be more careful about separating the inner track from outer. There's se…
May 26
More…