Rick McConney
/
StarterKit
GSMA version
Fork of AvnetATT_shape_hackathon by
Diff: hts221_driver.cpp
- Revision:
- 11:e6602513730f
- Parent:
- 1:af7a42f7d465
- Child:
- 28:886833917643
diff -r df54436ecd38 -r e6602513730f hts221_driver.cpp --- a/hts221_driver.cpp Mon Jul 11 23:54:24 2016 +0000 +++ b/hts221_driver.cpp Tue Jul 12 03:11:05 2016 +0000 @@ -8,14 +8,16 @@ #include <string> #include "mbed.h" -I2C i2c(PTC11, PTC10); //SDA, SCL -- define the I2C pins being used +#include "hardware.h" +//I2C i2c(PTC11, PTC10); //SDA, SCL -- define the I2C pins being used // Read a single unsigned char from addressToRead and return it as a unsigned char unsigned char HTS221::readRegister(unsigned char slaveAddress, unsigned char ToRead) { char data = ToRead; - i2c.write(slaveAddress, &data, 1, 0); + //i2c.write(slaveAddress, &data, 1, 0); + i2c.write(slaveAddress, &data, 1, 1); //by Stefan i2c.read(slaveAddress, &data, 1, 0); return data; }