Seeed I2C touch example

Dependencies:   MPR121 mbed

Fork of MPR121_HelloWorld by Sam Grove

main.cpp

Committer:
sam_grove
Date:
2014-08-15
Revision:
2:383e257538ff
Parent:
1:684222fa16bb

File content as of revision 2:383e257538ff:

#include "mbed.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);
    }
}