Sleep Statement

Pauses execution for the specified number of seconds. Currently moving motors will continue moving, but no other operations will occur until the sleep period is over. The time must be provided as a floating point number.

Syntax

  1. sleep(time);

Example

  1. //Use Motors 2 & 4 to turn sharply for 3.7 seconds.
  2. void main()
  3. {
    1. motor(2,95);
    2. motor(4,-95);
    3. sleep(3.7);
    4. ao();
  4. }