In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Zoot wrote: [code] RCchan1 PIN RA.0 INPUT RCx VAR Byte ' for storing input WATCH RCx Get_RC_Pulse: IF RCchan1 = 1 THEN Get_RC_Pulse ' wait for pin to go low PULSIN RCchan1, 1, RCx ' measure 10 - 2550 us pulse, 0 = 0ms, 100 = 1ms, 200 = 2ms, 150 = 1.5ms (neutral) ' now RCX approx 100-200 (if there are actual pulses). You could adjust it so 128 = neutral...., etc GOTO Get_RC_Pulse [/code] Personally, I would poll RC receiver pin(s) in an interrupt, so that the last pulsewidth is always available "in the background", but the above should work. You might want to perform so error checking on the received value in case the pulsewidth is too long or too short (which could indicate that the transmitter is not on, or there is noise, etc). ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=282337#m282343 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)