Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: Seeed_Grove_I2C_Touch_Example MPR121_HelloWorld mbed_petbottle_holder_shikake test_DEV-10508 ... more
Diff: MPR121.cpp
- Revision:
- 6:b6bb38744edd
- Parent:
- 5:3934358ec2b7
- Parent:
- 4:c1bc00c5e8e5
--- a/MPR121.cpp Fri Aug 15 23:00:13 2014 +0000
+++ b/MPR121.cpp Fri Aug 15 23:04:08 2014 +0000
@@ -194,9 +194,9 @@
uint8_t result = 0;
result = _i2c->write(_i2c_addr, buf, 2);
-
- if(result && DEBUG) {
- debug("I2c write failed\n");
+ if(result && DEBUG)
+ {
+ debug("I2C write failed\n");
}
return;
@@ -208,10 +208,11 @@
uint8_t result = 1;
result &= _i2c->write(_i2c_addr, buf, 1, true);
- result &= _i2c->read(_i2c_addr, &data, 1);
-
- if(result && DEBUG) {
- debug("I2c read failed\n");
+ result &= _i2c->read(_i2c_addr, &data, 1);
+
+ if(result && DEBUG)
+ {
+ debug("I2C read failed\n");
}
return data;
Freescale MPR121
Grove Touch Sensor