MAXIM DS3231 accurate Real Time Clock Library
Fork of DS3231 by
Diff: DS3231.cpp
- Revision:
- 1:84ccc64067d8
- Parent:
- 0:11dfd7ac4188
diff -r 11dfd7ac4188 -r 84ccc64067d8 DS3231.cpp --- a/DS3231.cpp Sat Dec 22 19:23:19 2012 +0000 +++ b/DS3231.cpp Sat Dec 22 19:56:16 2012 +0000 @@ -25,7 +25,13 @@ int w=i2c.write(DS3231_Address,buf,1); int r=i2c.read(DS3231_Address,buf,2); error=((w!=0)||(r!=0)); - return(buf[0]+buf[1]/256.0);} + return(buf[0]+buf[1]/256.0);} + +// force temperatue conversion +void DS3231::convertTemperature() + {int Control=readRegister(DS3231_Control)|DS3231_bit_CONV; + writeRegister(DS3231_Control,Control); + } // decode time registers void DS3231::decodeTime(int regHours, int regMinutes, int regSeconds,int *Hours, int *Minutes, int *Seconds)