
• GND
→
GND
• IRQ
→
D2
You will also want to connect the Electrode/LED pins to your electrode
material you selected previously. You will want to make sure you have a
good, solid connection between your material and your board, so make
sure you thoroughly solder your connections.
Check out the Fritzing diagram below for how your connections should look.
The yellow squares represent whatever material you decide to use for your
electrodes.
Communicating with the Breakout
Board
To communicate with your breakout board, you will need the Arduino
sketch available as a zip file here. Alternatively, you can also find the most
up-to-date firmware for working with the breakout board available on
GitHub. Let’s take a look and see exactly what the code is doing.
#include
"mpr121.h"
#include
<Wire.h>
int irqpin
= 2;
//
Digital
2
boolean touchStates[12];
//to
keep
track
of
the
previous
t
ouch
states
In this first section of the code, the MPR121 library and the Wire library are
initialized. The Wire library makes I C communication easy to use on the
Arduino. The sketch also defines digital pin 2 as the IRQ pin connection,
and creates 12 instances of the boolean variable touchStates.
For the second section of the code, we define the
irqpin
as an INPUT,
telling the Arduino to monitor the digital signal coming in over that pin.
Serial communication is also started at 9600 bps, s well as the Wire and
mpr121 libraries.
2
Page 3 of 24