Shop OBEX P1 Docs P2 Docs Learn Events
Radio Control Receiver Interface — Parallax Forums

Radio Control Receiver Interface

Rich MaysRich Mays Posts: 4
edited 2005-11-04 16:12 in General Discussion
I would like to read servo positions from a radio control receiver.· Looking through the Javelin docs, my guess is that I would need to make a VP that reads the state of a pin (with CPU.readPIN) and measure the time between pulse rise and fall.· Does this seem to be a realistic approach?· Has anyone done this before?

Also, the receiver and javelin will be on the same power source, so should have a common ground.· Can I just wire the receiver servo output straight to the javelin pin?· Is there a schematic for feeding a digital signal into a pin that I should use?

Thanks,
Rich

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-11-04 15:43
    You'll actually want to use CPU.pulseIn() to measure the width of the control pulse -- this sets the servo position (1.0 ms = full left, 2.0 ms = full right).· And yes, with a common ground you can take the servo pulse output and feed it directly into the Javelin.· If you're worried at all about an electrical failure, you can put a 1K resistor inline with the Javelin input pin; this will protect the Javelin in the event a programming error puts the pin into an output state.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Rich MaysRich Mays Posts: 4
    edited 2005-11-04 16:12
    Jon,

    Thanks for the info.· I looked at pulseIn and was worried that it may have problems with reading a pulse that repeats.· I was worried that if I set the timeout too long, it may measure two (or more) pulses, and if I set it too low, I might not get the entire pulse.· Even if I did set the timeout right, it may not be in synch with the receiver signal.·

    Is my understanding of how pulseIn works accurate?· If not, how does it work?· What does the function return if more than one pulse occurs during the timeout?

    Thanks,
    Rich
Sign In or Register to comment.