Processor Interrupts with Arduino

Pages
Contributors: JordanDee, Ell C
Favorited Favorite 8

Hardware Hookup

In the following sections, we'll look at a simple example to make more sense of interrupts and how they work. If you'd like to follow along, grab a Sparkfun RedBoard, an LED, a button, 330Ω resistor, jumper wires, and a cable to power it all.

SparkFun RedBoard - Programmed with Arduino

SparkFun RedBoard - Programmed with Arduino

DEV-13975
$19.95
47
Multicolor Buttons - 4-pack

Multicolor Buttons - 4-pack

PRT-14460
$1.60
Jumper Wires Premium 6" M/M Pack of 10

Jumper Wires Premium 6" M/M Pack of 10

PRT-08431
$3.95
2
Resistor 330 Ohm 1/4 Watt PTH - 20 pack (Thick Leads)

Resistor 330 Ohm 1/4 Watt PTH - 20 pack (Thick Leads)

PRT-14490
$0.95
LED - Basic Red 5mm

LED - Basic Red 5mm

COM-09590
$0.35
USB Mini-B Cable - 6"

USB Mini-B Cable - 6"

CAB-13243
$1.95
4

Connect the LED to pin 13 and the button to pin 2 as you see in the Fritzing diagram below:

Example Interrupt Circuit

If you take a good look at what you've just hooked up, you'll notice that the LED is actually redundant. We could just use the built-in LED on pin 13, but for visual purposes, we added the external LED.