Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Arduino Essentials
  • Toc
  • feedback
Arduino Essentials

Arduino Essentials

By : Perea
5 (5)
close
Arduino Essentials

Arduino Essentials

5 (5)
By: Perea

Overview of this book

If you are a hobbyist who wants to develop projects based on Arduino as the main microcontroller platform or an engineer interested in finding out what the Arduino platform offers, then this book is ideal for you. Some prior knowledge of the C programming language is required.
Table of Contents (12 chapters)
close
11
Index

Time control functions

The Arduino library has four functions that allow us to manage the time. We have already seen one of them, the delay() function, which we have used from our first sketch to stop the execution of the code for a short period of time.

As we saw in Chapter 3, Interacting with the Environment the Digital Way, the delay() function accepts only one parameter: the desired number of milliseconds to pause. For most projects, this resolution will be fine, but there can be situations where a millisecond is too much.

For these kinds of problems, the Arduino library also offers the delayMicroseconds() function that, as you can imagine, pauses the code execution for just the number of microseconds that you set as its only parameter.

A microsecond is a millionth of a second, or to put it another way, there are a thousand microseconds in a millisecond and a million microseconds in a second.

Due to restrictions in the Arduino architecture, the maximum delay the delayMicroseconds() function...

bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete