James Holbrook's Posts (1)

Sort by

Reading PWM from a receiver

Hey all.I know this subject has been covered in many ways, but I am hoping that someone can assist me. I hope someone can have the patience to answer a few of my VERY NEWB questions.What I am trying to do is to send PWM to an arduino on an air vehicle which will then send the appropriate servo controls. Simple enough some may say, but I am in a bind since I just cannot get my head wrapped around this and frankly, I think my research has gotten me confused.My BASIC NEED is to be able to see the pulsewidth values in Milliseconds or in PWM values on Serial Monitor and see the values change as the sticks and knobs are moved.I know some may say, why not just use RC to control the servos without the Arduino? The answer to that is that I want to eventually turn control over to the Arduino like in ArduPilot, and use the Arduino as an IMU sort of. The ArduPilot code has been interesting to analyze but I have not gotten closer to my VERY BASIC need. Being able to look at the ArduPilot Pro code would likely be a very good insight......but that is not available to my knowledge.I have tried ServoDecode, ServoTimer2 and SerialServer libraries and I can capture the PPM for the channels alright on Pin 8, but it does not show me the changes to the pulsewidth when the sticks are moved. I thought I might have what I needed by downloading Chris' RCTest code but since I don't want to move anything like motors for thrust or vectoring and tried to uncomment the Servo stuff it doesn't do anything. When I compile it and run, it does nothing. It just sits there and the servos just jitter and sometimes go to extreme lock..I just need to see the pulsewidths and move SERVOS accordingly.. Jordi in his thread to Hack a receiver was a good piece of code, but the next file he released to read the PPM just displays a scattered array of numbers that don't relate to anything. In that code, and in finding the PPM string I get a value that goes like 214567. Is this a MicroSecond value and how could one convert this to a Milli-Second value? Multiply by 1000?Thanks to all in advance for any help or direction you may send my way.Happy Holidays to all.Jim
Read more…