HDC1000 library
Dependents: Condensation_Monitor mbed_HDC1000 BLE_Condensation_Monitor GR-PEACH_TAMORI
See http://developer.mbed.org/users/yasuyuki/notebook/HDC1000/
Revision 1:45126276dbf3, committed 2015-07-10
- Comitter:
- yasuyuki
- Date:
- Fri Jul 10 15:00:59 2015 +0000
- Parent:
- 0:82c214412005
- Commit message:
- unsigned short
Changed in this revision
HDC1000.cpp | Show annotated file Show diff for this revision Revisions of this file |
HDC1000.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r 82c214412005 -r 45126276dbf3 HDC1000.cpp --- a/HDC1000.cpp Wed Jan 28 08:53:47 2015 +0000 +++ b/HDC1000.cpp Fri Jul 10 15:00:59 2015 +0000 @@ -26,7 +26,7 @@ // Trigger buf[0] = 0x00; // Pointer - _i2c.write(HDC1000_ADDR, buf, 1); + _i2c.write(HDC1000_ADDR, buf, 1); // with stop // Wait 6.35ms + 6.5ms wait_ms(20); @@ -36,7 +36,7 @@ } -int HDC1000::humidity() +unsigned short HDC1000::humidity() { // get hum @@ -47,7 +47,7 @@ } -int HDC1000::temperature() +unsigned short HDC1000::temperature() { // get temp @@ -60,6 +60,9 @@ void HDC1000::init() { + + wait_ms(15); + // Set configuration buf[0] = 0x02; // Pointer buf[1] = 0x10; // High byte @@ -68,3 +71,4 @@ } +
diff -r 82c214412005 -r 45126276dbf3 HDC1000.h --- a/HDC1000.h Wed Jan 28 08:53:47 2015 +0000 +++ b/HDC1000.h Fri Jul 10 15:00:59 2015 +0000 @@ -26,8 +26,8 @@ HDC1000 (I2C& p_i2c); void get(); - int humidity(); - int temperature(); + unsigned short humidity(); + unsigned short temperature(); void init(); protected: