Shop OBEX P1 Docs P2 Docs Learn Events
how can i know the time with BS2 ? (DUPLICATE THREAD) — Parallax Forums

how can i know the time with BS2 ? (DUPLICATE THREAD)

farsadfarsad Posts: 27
edited 2007-07-22 19:24 in BASIC Stamp
dear friends:

i want to record some data with my BS2 every one hour (like a data logger). my problem is that i don't know when to recored the data and how i can use the BS2 clock for knowing the time. for example, in QBasic or VBasic there is a Time function which returns the current time and i can use it and collect my data every one hour. is there any similar function in PBasic?



thanks

Post Edited By Moderator (Chris Savage (Parallax)) : 7/23/2007 2:14:58 PM GMT

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-07-22 19:19
    There is no built-in clock in any of the Stamps although the SLEEP / NAP / PAUSE statements can be used to mark time. If you need time-stamping to a one second resolution with reproducibiiity, use an external clock like the DS1302 (www.parallax.com/detail.asp?product_id=604-00005). If you just need to log data once an hour with accuracy within a few seconds, you should be fine without the external clock. With the SLEEP / NAP / PAUSE statements, the BS2 is waiting for the specified time to finish and can't do anything else. Using an external clock, the BS2 can do other control functions, one of which is checking the clock from time to time looking for an hour to elapse.

    Using SLEEP or NAP has the advantage that power consumption drops markedly during the wait. This is very handy for data logging. See this website for some discussion: www.emesystems.com.
  • QuattroRS4QuattroRS4 Posts: 916
    edited 2007-07-22 19:24
    both the 'no subject' posts were duplicated further down

    http://forums.parallax.com/forums/default.aspx?f=5&m=203495

    Rgds,
    QuattroRS4

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Necessity is the mother of invention'

    Post Edited (QuattroRS4) : 7/23/2007 1:59:49 AM GMT
Sign In or Register to comment.