It's a bit difficult to make a stopwatch using a Stamp. The problem is that the Stamps do not have an internal clock that's readable by a program. Some statements have provisions for timeouts and specific pauses that are quite precise, but the Stamp stops doing other things and the cumulative time is not kept anywhere. You could certainly make a stopwatch to keep time in hundredths of a second, but it would take some tuning and adjusting for display timing. You'd use a PAUSE 10 to provide a 10 millisecond time "tick", but you'd have to adjust that to account for the execution times of other statements in your inner timing loop. You could add an external timer to provide a binary 10 millisecond (or even 1 millisecond) clock that the Stamp could turn on and off, clear, and read with the Stamp just controlling the external timer and managing the display and user interactions.
Mike Green said...
It's a bit difficult to make a stopwatch using a Stamp. The problem is that the Stamps do not have an internal clock that's readable by a program. Some statements have provisions for timeouts and specific pauses that are quite precise, but the Stamp stops doing other things and the cumulative time is not kept anywhere. You could certainly make a stopwatch to keep time in hundredths of a second, but it would take some tuning and adjusting for display timing. You'd use a PAUSE 10 to provide a 10 millisecond time "tick", but you'd have to adjust that to account for the execution times of other statements in your inner timing loop. You could add an external timer to provide a binary 10 millisecond (or even 1 millisecond) clock that the Stamp could turn on and off, clear, and read with the Stamp just controlling the external timer and managing the display and user interactions.
Comments
Thanks Mike for the info!