3 key touch panel from Seeed

Dependencies:   MPR121

Fork of Seeed_Grove_I2C_Touch_Example by Seeed

main.cpp

Committer:
tulanthoar
Date:
2017-06-29
Revision:
3:81ea1b6e3fea
Parent:
2:383e257538ff
Child:
5:50d9e7608cf0

File content as of revision 3:81ea1b6e3fea:

#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);
        wait(0.1f);
    }
}