Skip to Content
Exploring Arduino, 2nd Edition
book

Exploring Arduino, 2nd Edition

by Jeremy Blum
November 2019
Beginner
512 pages
11h 50m
English
Wiley
Content preview from Exploring Arduino, 2nd Edition

13Interrupts and Other Special Functions

Parts You'll Need for This Chapter

  • Arduino Uno or Adafruit METRO 328
  • USB cable (Type A to B for Uno, Type A to Micro-B for METRO)
  • Half-size or full-size breadboard
  • Assorted jumper wires
  • Pushbutton
  • 100Ω resistor
  • 220Ω resistors (×3)
  • 10kΩ resistor
  • 5 mm Common-anode RGB LED
  • 10μF 50V electrolytic capacitor
  • Piezo buzzer
  • 74AHCT14 hex inverting Schmitt trigger

Up to this point, every Arduino program you've written has been synchronous. This presents a few problems, one being that using delay() can preclude your Arduino from doing other things. There are a variety of ways to make your Arduino multitask so that you don't waste any valuable processor cycles doing nothing.

In this chapter, you will learn how to leverage both timer and hardware interrupts to make your Arduino sketches asynchronous. Interrupts make it possible to execute code asynchronously by triggering certain events (time elapsed, input state change, and so on). Interrupts, as their name implies, allow you to stop whatever your Arduino is currently doing, complete a different task, and then return to whatever command the Arduino was previously executing. You will also learn how to execute interrupts ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Practical Electronics for Inventors, Fourth Edition, 4th Edition

Practical Electronics for Inventors, Fourth Edition, 4th Edition

Paul Scherz, Simon Monk

Publisher Resources

ISBN: 9781119405375Purchase book