In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Zoot wrote: Oh, yeah, and you'd need to do this in the ISR (which is a bit long but looks basically OK). [code] IF General_Var(1) = [b]5[/b] THEN ' status of the USD: 2=wait+start pulse, 3=end pulse + prepare reading, 4=reading led1 = ison IF USD_Pin = 1 THEN ' measuring the ping pulse. count up time variable (rawdata) as long as there is high at the USD INC rawdata ' store results in rawdata ENDIF ENDIF [/code] ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=394074#m401110 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)