IO Abstraction library fully supports the MPR121 12-bit Touch control and IO expander chips on Arduino and mbed. It requires only two pins (three for interrupt mode) SDA, SCL, and optionally INT. Our driver integrates the Touch, GPIO, LED controller, and interrupt support providing nearly all functions using familiar Arduino terminology.
This device can even be used in conjunction with an MPR121 analog device to make it even easier to use the LED controller.
The MPR121 is a pretty complete device, and has most capabilities of Arduino pins, however there are several notes:
See the example for more on how to use this device, it is more complex to set up than most other devices and better explained in the example.
Once you have created an instance, simply use it like any other IoAbstraction they all work the same way.
To find your i2c device address use this i2c address scanner, this sketch will tell you every address on which it finds an i2c chip.
If you want to use the LED control function of the device, there is an additional output type, it is LED_CURRENT_OUTPUT
. You can enable the LED mode two ways.
ioAW9523.pinMode(pin, LED_CURRENT_OUTPUT);
analogAw9523.initPin(pin, DIR_PWM);
See the reference docs linked above or example for more information.