• Puriphico

time functions in arduino programming

  • Delay()

  • Pauses the program for a specified amount of milliseconds.

  • Syntax is delay(ms).

  • delayMicroseconds()

  • Same as delay, but in microseconds.

  • Is inaccurate for values larger than 16383; nearing this number, it is simplest to use the standard delay function.

  • micros()

  • When this function is called, it returns the number of microseconds since the arduino board began running.

  • Will reset after approximately 70 minutes of board operation.

  • Syntax is as follows: time = micros( )

Here is an example. Note that time is declared as a variable, which is referenced later using the communication function, Serial.println.

  • millis()

  • Same as micros(), but in milliseconds.

  • Overflow, or reset point, is currently 50 days.

  • Syntax is as follows: time = millis( )

#TimeFunctions #delays #Delays #Arduino #Programming #Puriphico