Shop OBEX P1 Docs P2 Docs Learn Events
how to build a stopwatch — Parallax Forums

how to build a stopwatch

KreyNeeUhmKreyNeeUhm Posts: 2
edited 2009-12-20 07:19 in BASIC Stamp
Hello all! I was wondering if it possible to make a stopwatch using a BS2-sx controller?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-12-20 05:20
    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.
  • KreyNeeUhmKreyNeeUhm Posts: 2
    edited 2009-12-20 07:19
    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.



    Thanks Mike for the info!
Sign In or Register to comment.