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

The concept of an interruption


As you may have intuited, an interrupt is a special mechanism the CPU incorporates to have a direct channel to be noticed when some event occurs.

Most Arduino microcontrollers have two of these:

  • Interrupt 0 on digital pin 2

  • Interrupt 1 on digital pin 3

But some models, such as the Mega2560, come with up to five interrupt pins.

Once an interrupt has been notified, the CPU completely stops what it was doing and goes on to look at it, by running a special dedicated function in our code called Interrupt Service Routine (ISR).

When I say that the CPU completely stops, I mean that even functions such as delay() or millis() won't be updated while the ISR is being executed.

Interrupts can be programmed to respond on different changes of the signal connected to the corresponding pin and thus the Arduino language has four predefined constants to represent each of these four modes:

  • LOW: It will trigger the interrupt whenever the pin gets a LOW value

  • CHANGE: The interrupt will...

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