In SX Microcontrollers, SX/B Compiler and SX-Key Tool, JonnyMac wrote: Zach, I've attached a fairly simple program that does "background" timing. Since you're new it may take some time to come to grips with, but it won't take too long to figure out what's going on. Keep in mind that whenever you do background stuff (with an interrupt), built-in functions that are time-sensitive are adversely affected. In the program I've included subroutine that replaces PAUSE should you need to do timed delays while the counter is running, or after the counter is stopped. As with PAUSE, you can't check inputs while DELAY_MS is running, but the counter is still updated. You'll see by the listing that you start you timer with the SET_TIMER subroutine and then you can check it at any time for being zero. The demo program starts the timer and watch for it to time out or a button press before lighting an Led. The program is running nicely on my PDB. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=251837#m251999 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)