Arduino millis() – The Beginners Guide to multi-tasking with Arduino using millis()
Arduino millis() or delay() – which should I use? How can I time multiple events with Arduino? How can I multi-task with Arduino? Can I still get inputs and have timed events? What is a hardware clock anyway?
So many questions about Arduino timing…so little time?
Which is why we created this Ultimate Guide to using the Arduino millis() function.
We have created 6 in-depth video lessons that include written tutorials and code as well – all covering using millis() and delay()
Below are links and topics covered in this mini-series training:
Lesson 1: millis() Arduino Function: 5+ things to consider
Topics covered:
- What is a hardware clock?
- Timer/Counter() modules
- How to “get” the value from millis()
- Storing the value of millis()
- Doing math with unsigned longs (variables that are perfect for storing millis values)
Lesson 2: delay() Arduino Function: Tight loops and blocking code
Topics covered:
- Tight loops
- Blocking code
Lesson 3: millis() vs delay()
Topics covered:
- The simple timed event
- The not so simple timed event
Lesson 4: When delay() should be millis() instead
Topics covered:
- Issues with inputs and delay()
Lesson 5: Arduino Sketch with millis() instead of delay()
Topics covered:
- Quick review of the millis function
- The millis timeline
- Create once-off timed events
- Create repetitive timed events
Lesson 6: Doing multiple timed things with Arduino: Unleash the millis()!
Topics covered:
- Map out a program with 2 INDEPENDENT timed events
- Code from scratch a program using millis() to time 2 repetitive events
Have more questions about using millis()? Let us know in the comments below!
[…] post Arduino millis() – The Beginners Guide to multi-tasking with Arduino using millis() appeared first on Programming Electronics […]
Clear and effective teaching presentation. Thankyou. I’m finally beginningto learn and understand a little Arduino C++ thinking and reasoning.
Please sir, is any site, I can get how to read Analog voltage, on microC compiler thanks.
I am impressed by your video’s but I am at an age where I have to repeat the info multiple times before it sticks. Would you consider printing al these fantastic wisdom in book form?
So how did you get the cardboard cutout to blink eyes and run servo at the same time? Or is this not actually possible (just one after the other)?
Great question Steve! Yes, it is possible, using millis(). If you watch all the lessons referred to in this post, it should help walk you through it. Best of luck!