Shop OBEX P1 Docs P2 Docs Learn Events
PAUSE command — Parallax Forums

PAUSE command

aa200orionaa200orion Posts: 10
edited 2009-09-13 23:38 in BASIC Stamp
Is there a way to generate a 4.2ms delay, or any fractional delay, ·using the PAUSE command in PBasic 2.5?

Thanks, Jimmy

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-09-13 20:06
    No

    One way to generate finer delays is to use a PULSOUT statement using an unused I/O pin. The pulse width can be specified to the nearest 2us on a BS2 and the I/O pin used is left unconnected. The PULSOUT takes the specified amount of time to execute plus some overhead. The problem is that the overhead is significant. The PBasic statements themselves take time to execute, anything from 210us on up and that has to be accounted for in any delays. www.emesystems.com has a discussion on PBasic statement execution time (click on app-notes at the bottom of the page).
  • aa200orionaa200orion Posts: 10
    edited 2009-09-13 23:38
    Thanks Mike, I'll give it a try.
Sign In or Register to comment.