In SX Microcontrollers, SX/B Compiler and SX-Key Tool, JonnyMac wrote: I've use the Ping with SX/B; in a project where I needed to read distance with one-inch resolution I used this function: [code] FUNC GET_INCHES HIGH PingIO PAUSEUS 10 LOW PingIO PAUSEUS 5 INPUT PingIO tmpB1 = 0 \ JNB PingIO, $ DO INC tmpB1 PAUSEUS 73.746 LOOP UNTIL PingIO = 0 RETURN tmpB1 ENDFUNC [/code] This takes advantage the the ability to use fractional values with PAUSEUS (works for PAUSE, too). ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=188113#m188137 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2007 (http://www.dotNetBB.com)