February 2009
Beginner
128 pages
2h 45m
English
Arduino includes functions for measuring elapsed time and also for pausing the sketch.
Returns the number of milliseconds that have passed since the sketch started.
Example:
duration = millis()-lastTime; // computes time elapsed since "lastTime"
Pauses the program for the amount of milliseconds specified.
Example:
delay(500); // stops the program for half a second
Pauses the program for the given amount of microseconds.
Example:
delayMicroseconds(1000); // waits for 1 millisecond
Read now
Unlock full access