Shop OBEX P1 Docs P2 Docs Learn Events
BS2 program question newbie alert — Parallax Forums

BS2 program question newbie alert

hiflyenhiflyen Posts: 4
edited 2011-11-24 00:35 in BASIC Stamp
I am modifying the "Alarm system" in the "what's a microcontroller V3.0. My question is if that program were to be ran would the BS2 go to a sleep or hibernate mode? I'm trying to use this modified program to maintain certain water levels, and I want to make sure that the program keeps running continuously. If it does sleep is there something I can do to keep it running?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2011-11-23 19:40
    The Alarm program (page 314?) sits in a DO / LOOP loop that never ends, so the program never ends. The Stamp do not have any way to automatically sleep or nap although there are SLEEP and NAP (and PAUSE) statements that will stop execution for a specified amount of time (see the Basic Stamp Syntax and Reference Manual for specifics). A program that "falls through" to the END statement or reaches a STOP statement will cause the Stamp to stop executing, but there's nothing to make this happen by itself. There also are some errors that can cause a reset to occur, like doing a RETURN when there was no corresponding GOSUB.
  • hiflyenhiflyen Posts: 4
    edited 2011-11-24 00:35
    Thank you.
Sign In or Register to comment.