Library for the DS1721, 2-Wire Digital Thermometer and Thermostat from Dallas Semiconductor (Maxim Integrated)
Fork of DS1721 by
Revision 3:38d2fcae2f7c, committed 2014-04-29
- Comitter:
- chaegle
- Date:
- Tue Apr 29 23:54:46 2014 +0000
- Parent:
- 2:22dbeccb82be
- Commit message:
- Modified class constructor so as to specify an I2C bus speed of 400KHz. Not doing so prohibits this library from working properly on the FRDM-K64F platform.
Changed in this revision
DS1721.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 22dbeccb82be -r 38d2fcae2f7c DS1721.cpp --- a/DS1721.cpp Tue Jul 30 20:23:07 2013 +0000 +++ b/DS1721.cpp Tue Apr 29 23:54:46 2014 +0000 @@ -41,17 +41,19 @@ DS1721::DS1721(I2C &i2c, int addr) : m_i2c(i2c) , m_addr(addr) { - _resolution = RES_9_BIT; - _polarity = POLARITY_ACTIVE_HIGH; - _mode = CONV_FOREVER; - _num_read = 1; + m_i2c.frequency(400000); + _resolution = RES_9_BIT; + _polarity = POLARITY_ACTIVE_HIGH; + _mode = CONV_FOREVER; + _num_read = 1; - //setConfig(_resolution | _polarity | _mode); + //setConfig(_resolution | _polarity | _mode); } DS1721::DS1721(I2C &i2c, int resolution, int polarity, int mode, int addr) : m_i2c(i2c) , _resolution(resolution) , _polarity(polarity) , _mode(mode) , m_addr(addr) -{ +{ + m_i2c.frequency(400000); _num_read = 1; //setConfig(_resolution | _polarity | _mode); }