
void setup(){
pinMode(irqpin,
INPUT);
digitalWrite(irqpin,
HIGH);
//enable
pullup
resistor
Serial.begin(9600);
Wire.begin();
mpr121_setup();
}
The main loop of the code is incredibly simple, as it only calls a single
function.
void loop(){
readTouchInputs();
}
The function is actually described in the next section of the code. The
Arduino requests the electrode states from the sensor in the first section,
and the least significant bits and most significant bits are defined for the
sensor.
Page 4 of 24