Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: ILI9341_Clock_Nucleo
Fork of DS3231 by
Diff: DS3231.cpp
- Revision:
- 1:84ccc64067d8
- Parent:
- 0:11dfd7ac4188
--- 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)
