Processor Interrupts with Arduino

Pages
Contributors: JordanDee, Ell C
Favorited Favorite 10

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
$21.50
49
Multicolor Buttons - 4-pack

Multicolor Buttons - 4-pack

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

Jumper Wires Premium 6" M/M Pack of 10

PRT-08431
$4.50
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
$1.05
USB Mini-B Cable - 6"

USB Mini-B Cable - 6"

CAB-13243
$2.10
4
LED - Basic Red 5mm

LED - Basic Red 5mm

COM-09590
$0.45

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.