In SX Microcontrollers, SX/B Compiler and SX-Key Tool, mojorizing wrote: It looks like you're clearing your runflag in a few places without any corresponding action. The way you're using the interrupt will tell you a ball has passed by, not that the ball had just passed by. The code is polling the value of the runflag, but in a few places the runflag has cleared before it is polled possibly erasing the fact that the ball has passed by. One possible solution is to poll the switch in the Main code to capture time the first ball has rolled by, then using the interrupt routine to capture the second ball rolling by. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=412878#m412984 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)