You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+34-6Lines changed: 34 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,8 +13,18 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY
13
13
14
14
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/gpl.html>
15
15
16
-
## Important note: Library v2.0.0
16
+
## Version 3.0.0 notes
17
+
Version 3.0.0 adds the ability to address different I2C peripherals for microcontrollers that have more than one (e.g. `Wire`, `Wire1`, etc.) There is one situation that is not backwards compatible with earlier versions of the library. Code that calls `setSyncProvider()` in the [Time library](https://github.com/PaulStoffregen/Time), e.g.:
18
+
```c++
19
+
setSyncProvider(myRTC.get);
20
+
```
21
+
Needs to change as follows:
22
+
```c++
23
+
setSyncProvider([](){return myRTC.get();});
24
+
```
25
+
This uses a lambda to provide the Time library with a static function, which it requires. The `MCP79412::get()` function was static in previous versions of the library, but no longer is in v3.0.0. This allows the flexibility to operate with different I2C peripherals.
17
26
27
+
## Version 2.0.0 notes
18
28
The 2.0.0 version of the library has some significant changes and is not completely backwards compatible with earlier versions. These changes provide a more consistent API and reduce the possibility of name collisions. While sketches using this library will likely require changes as a result, these should be mostly straightforward.
19
29
20
30
- The library no longer defines a `DS3232RTC` object, therefore each sketch needs to define one. (Previous versions of the library defined a DS3232RTC object named `RTC`, although only for AVR architecture. Consider using a name other than `RTC` as this can cause a name collision on some architectures.)
@@ -41,6 +51,7 @@ The following example sketches are included with the **DS3232RTC** library:
41
51
-**rtcTimeTemp:** Displays time and temperature.
42
52
-**rtc_temperature:** Displays time and temperature but initiates a temperature conversion every 10 seconds in addition to the RTC's default conversion period of 64 seconds.
43
53
-**rtc_interrupt:** Uses a 1Hz interrupt from the RTC to keep time.
54
+
-**rtc_wire1:** Raspberry Pi Pico example using `Wire1`.
44
55
-**mcu_clock_drift:** Demonstrates that MCU time as kept by the **Time** library will drift as compared to RTC time, and that MCU time may not increase by one second every second.
45
56
-**tiny3232_KnockBang:** Demonstrates interfacing an ATtiny45/85 to a DS3231 or DS3232 RTC.
46
57
- Several examples for using the RTC alarms. See the [alarm primer](https://github.com/JChristensen/DS3232RTC/blob/master/alarm-primer.md) for more information.
@@ -87,18 +98,20 @@ Symbolic names used with the squareWave() function (described below).
87
98
- SQWAVE_8192_HZ
88
99
89
100
## Constructor
90
-
### DS3232RTC()
101
+
### DS3232RTC(TwoWire& wire)
91
102
##### Description
92
-
Instantiates a DS3232RTC object.
103
+
Instantiates a `DS3232RTC` object.
93
104
##### Syntax
94
-
`DS3232RTC myRTC;`
105
+
`DS3232RTC myRTC(wire);`
95
106
##### Parameters
96
-
None.
107
+
**wire:** An optional parameter to specify which I2C bus to use. If omitted, defaults to `Wire`. *(TwoWire&)*.
Returns the value of the oscillator stop flag (OSF) bit in the control/status register which indicates that the oscillator is or was stopped, and that the timekeeping data may be invalid. Optionally clears the OSF bit depending on the argument passed. If the `clearOSF` argument is omitted, the OSF bit is cleared by default. Calls to `set()` and `write()` also clear the OSF bit.
0 commit comments