Shop OBEX P1 Docs P2 Docs Learn Events
count down timing??????? — Parallax Forums

count down timing???????

KARIM102KARIM102 Posts: 75
edited 2009-07-10 23:40 in BASIC Stamp
Dear all,
could somebody help me to bulid by using Basic stamp count down timing from O to 10 mins?????
best wishes

Comments

  • dev/nulldev/null Posts: 381
    edited 2009-07-08 13:32
    It depends on what you want to do. You can use the PAUSE command, which iterates in milliseconds.

    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    Counter VAR Nib
    Counter = 0
    DO
      PAUSE 60000 ' Pause one minute
      Counter = Counter + 1
    
    LOOP UNTIL (Counter = 10) ' 10 minutes.
    
    



    Basic stamps are not multiprocessors. If you want to do other processing while the counter is running, you have to get a 555 timer or a DS1302.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    /dev/null
  • Steve AndruesSteve Andrues Posts: 29
    edited 2009-07-10 23:40
    The DS1302 is getting to be my "go-to" chip for timing.· Since I want hours, minutes, and seconds (and do not care about month or day of the week) I set the chip for January 1, at midnight.· It reports the time since you reset the counter.· The rest is just some math if you want it to count down.
Sign In or Register to comment.