3 key touch panel from Seeed

Dependencies:   MPR121

Fork of Seeed_Grove_I2C_Touch_Example by Seeed

main.cpp

Committer:
Nate Yonkee
Date:
2017-06-29
Revision:
5:50d9e7608cf0
Parent:
3:81ea1b6e3fea
Child:
8:59e43faffe44

File content as of revision 5:50d9e7608cf0:

#include "mbed.h"
#include "rtos.h"
#include "MPR121.h"

I2C i2c(D14, D15);
MPR121 touch_pad(i2c, MPR121::ADDR_VSS);

int main()
{
    uint16_t button_val = 0;

    touch_pad.init();
    touch_pad.enable();

    while(1)
    {
        button_val = touch_pad.buttonPressed();
        printf("button = 0x%04x\n", button_val);
        Thread::wait(100);
    }
}