Shop OBEX P1 Docs P2 Docs Learn Events
Counting during Pollwait on a BS2px — Parallax Forums

Counting during Pollwait on a BS2px

ElectricAyeElectricAye Posts: 4,561
edited 2008-07-10 19:05 in BASIC Stamp
Greetings,

I have a question concerning the use of the POLLWAIT command if issued after a COUNT command on the BS2px.

Suppose I issue a COUNT command on pin 5 with a duration of 10 seconds. Pin 5 is now open to counts from the outside world.
But if my next line of program instruction issues a POLLWAIT command on pin 6 with a duration set to 8 (meaning it will halt program execution until something happy happens on pin 6), will counts keep coming in on pin 5 despite the unhappy state of pin 6? or does counting stop on pin 5 when the program execution is halted during the POLLWAIT of pin 6?

In other words, does counting continue despite the halt of program execution?

many thanks,
Mark

Comments

  • ElectricAyeElectricAye Posts: 4,561
    edited 2008-07-10 18:48
    The answer is that the Count command will not move on to the Pollwait command until the Count duration is completed. So Counting will not be going on when the Pollwait is put into action.

    This is called answering your own dumb question.

    sorry,
    Mark

    nono.gif
  • allanlane5allanlane5 Posts: 3,815
    edited 2008-07-10 19:05
    Sadly, the effect of "Basic Level Interrupts" like PollWait is that the condition is only checked BETWEEN Basic Keywords -- there's really no way to "interrupt" inside a Basic Keyword. This limits their usefullness. Sadly.
Sign In or Register to comment.