Wait, Waitms, Waitus

Waits a certain time before continuing program execution. Program execution is blocked completely during the wait, excluding Interrupts. They run anyway. it requires a korrektly defined system clock speed Avr.Clock. The precision of the Wait-Function when using Constant as parameters lies at around 1 µs 1).

Syntax:

  1. wait Expression (Secunds)
  2. waitms Expression (Milliseconds)
  3. waitus Constant (Microseconds)

As of Version 2012r2, you may also call wait and waitms with variables. Precision is then around 100 µs 2).

Example:

  dim a a byte
  a=200
  wait 3      ' wait 3 seconds
  waitms 100  ' wait 100 ms
  waitus 100  ' wait 100 µs
  waitms a    ' wait a variable time, time to wait in a
1) 20 MHz Controller. The lower the clock speed, the lower the wait time accuracy
2) 20 MHz Controller. The lower the clock speed, the lower the wait time accuracy.