Datasheet

To enable SPI, be sure to wire for SPI as shown in the Wiring section, and do a power reset of
your board so that the chip 'wakes up' in SPI mode
If you're using hardware SPI, check the SPI page for what pins you need to use, sometimes
they are only on the ICSP header which makes them trickier to use. (http://adafru.it/d5h)
To enable the hardware SPI interface, create the Adafruit_CAP1188 object with
Adafruit_CAP1188 cap = Adafruit_CAP1188(CAP1188_CS, CAP1188_RESET);
If you are using software SPI, you can use any pins that are not already used for some
purpose. In that case, create the object with
Adafruit_CAP1188 cap = Adafruit_CAP1188(CAP1188_CLK, CAP1188_MISO,
CAP1188_MOSI, CAP1188_CS, CAP1188_RESET);
Using the external IRQ Interrupt
Arduino has some basic ability to attach to pin interrupts, here's an example from
Nobody123 of connecting the IRQ pin from the CAP1188 to digital pin #3 on an Uno (Interrupt
#1) for tracking touches asynchronously
/***************************************************
This is a library for the CAP1188 I2C/SPI 8-chan Capacitive Sensor
Designed specifically to work with the CAP1188 sensor from Adafruit
----> https://www.adafruit.com/products/1602
These sensors use I2C/SPI to communicate, 2+ pins are required to
interface
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
Written by Limor Fried/Ladyada for Adafruit Industries.
BSD license, all text above must be included in any redistribution
****************************************************/
#include <Wire.h>
#include <SPI.h>
#include <Adafruit_CAP1188.h>
// Reset Pin is used for I2C or SPI
#define CAP1188_RESET 4
© Adafruit Industries https://learn.adafruit.com/adafruit-cap1188-breakout Page 16 of 19