htu21d_for_weather_shield
Dependents: SPARKFUN_WEATHER_SHIELD
Fork of htu21d by
Revision 4:fe060047cc24, committed 2016-10-20
- Comitter:
- isaackod
- Date:
- Thu Oct 20 16:47:38 2016 +0000
- Parent:
- 3:5c0f8e91d319
- Commit message:
- Changes to use with weather shield;
Changed in this revision
htu21d.cpp | Show annotated file Show diff for this revision Revisions of this file |
htu21d.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r 5c0f8e91d319 -r fe060047cc24 htu21d.cpp --- a/htu21d.cpp Thu Apr 30 00:34:03 2015 +0000 +++ b/htu21d.cpp Thu Oct 20 16:47:38 2016 +0000 @@ -1,6 +1,5 @@ /** HTU21D / HPP828E031 driver for mbed. -- Includes RTOS hooks if RTOS is detected during compile. Author: Kevin Braun **/ @@ -16,13 +15,12 @@ //--------------------------------------------------------------------------------------------------------------------------------------// //Contstructor -htu21d::htu21d(PinName sda, PinName scl) : _i2c(sda, scl) { - _i2c.frequency(400000); +htu21d::htu21d(I2C i2c) : _i2c(i2c) +{ + i2c.frequency(400000); } -htu21d::htu21d(PinName sda, PinName scl, int i2cFrequency) : _i2c(sda, scl) { - _i2c.frequency(i2cFrequency); -} + //--------------------------------------------------------------------------------------------------------------------------------------// //Destructor
diff -r 5c0f8e91d319 -r fe060047cc24 htu21d.h --- a/htu21d.h Thu Apr 30 00:34:03 2015 +0000 +++ b/htu21d.h Thu Oct 20 16:47:38 2016 +0000 @@ -104,7 +104,7 @@ * * @param PinName sda and scl, mbed I2C interface pins */ - htu21d(PinName sda, PinName scl); + htu21d(I2C i2c); /** * Constructor * - Fixed at I2C address 0x80 @@ -113,7 +113,6 @@ * @param PinName sda and scl, mbed I2C interface pins * @param int I2C frequency */ - htu21d(PinName sda, PinName scl, int i2cFrequency); /** * Destructor *