In SX Microcontrollers, SX/B Compiler and SX-Key Tool, bean wrote: You need to use the resolution parameter of RCTIME. I see you are using "2" now, just increase it to "8" and the value returned will be 1/4. So if using "2" would have returned 1000, then using "8" would return 250 and you can just test if irPulse > 250 irPulse VAR BYTE DO rctime rc.0, 1, irPulse, 8 LOOP UNTIL irPulse > 250 rctime rc.0, 1, irPulse, 4 IF irPulse > 150 THEN ' whatever ENDIF IF irPulse > 250 THEN ' whatever ENDIF ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=97532#m97546 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)