3 key touch panel from Seeed
Fork of Seeed_Grove_I2C_Touch_Example by
main.cpp
- Committer:
- Nathan Yonkee
- Date:
- 2017-07-02
- Revision:
- 8:59e43faffe44
- Parent:
- 5:50d9e7608cf0
- Child:
- 9:31065d903a2b
File content as of revision 8:59e43faffe44:
#include "mbed.h" #include "rtos.h" #include "MPR121.h" I2C i2c(PA_10, PA_9); MPR121 touch_pad(i2c, MPR121::ADDR_VSS); DigitalOut led(PB_3); Serial ser(SERIAL_TX, SERIAL_RX); int main() { uint32_t button_val = 20; /* touch_pad.enable(); */ while(1) { /* button_val = touch_pad.buttonPressed(); */ /* ser.printf("button = 0x%04x\n", button_val); */ ser.printf("trying\n"); button_val = touch_pad.isPressed(); ser.printf("any button pressed is (bool) %i\n",button_val); button_val = touch_pad.buttonPressed(); ser.printf("button_val is %i\n",button_val); Thread::wait(2000); } }