Compute Duration of an Action

The notion of time/duration is super important when you program, especially on embedded systems like Arduino. Writing a code that takes too much time, and not being able to know it, can lead to severe problems in your overall application.

For this post the goal will be to measure the duration of the famous digitalWrite() function. You’ll also get a template that you can use for measuring any piece of code you want in your Arduino programs.

Quick note before we get started: the duration you’ll measure will depend on your hardware. If you use an Arduino Uno or an Arduino Due (more computation power), you’ll get different results. For this tutorial I’ll be using an Arduino Uno.

Protected Area

This content is password-protected. Please verify with a password to unlock the content.

End Of Post

Other episodes

error: Content is protected !!