millis()

millis()

Tells you how much time has gone by since the Arduino was last turned on, or reset.

Returns

It returns the number of milliseconds that have passed since the Arduino was last turned on, or reset. The number it returns is a long. It can't count past 50 days, so it resets to 0 after about that much time.

Example

// Turns on the LED 5 seconds after Arduino is reset if ( millis() > 5000 ) { awesome.LED.turnOn(); }

Tips

The millis() function lets you add timing to your project, without using delay().

x

Goodbye and thanks for all the fish,

Thanks for helping us Kickstart Awesome Shield and learning with us. Sadly, turning Awesome Shield into a sustainable business didn’t work out and so we’re in the process of officially shutting down the company.

Read our full letter.

If you have an Awesome Shield you can keep using it and the learning platform.


Close Message