TimeDS1307 library

Driver library for RTC DS3231 and DS1307

Requirements

The library uses the Arduino wire library.

Usage

The RTC must be connected via I2C (aka TwoWire, TWI or simply Wire).

ArduinoRTC
GNDGND
+5VVCC
SDASDA
SCLSCL
SCLSQW

An instance of the class "TimeDS3231" is needed. As argument, the constructor expects the I2C address of the RTC (usually 0x3C).

#define RTC_I2C_ADDR 0x3C

TimeDS3231 Rtc(RTC_I2C_ADDR);

Functions

begin()

This function must be called to initialise the rtc.

Example:

Rtc.begin();
end()

This function switches off the display.

Example:

Rtc.end();
readDateTime(uint16_t *Year, uint8_t *Month, uint8_t *Day, uint8_t *Hour, uint8_t *Min, uint8_t *Sec, bool *Valid)

This function switches off the display.

Example:

Rtc.readDateTime();
writeDateTime(uint16_t Year, uint8_t Month, uint8_t Day, uint8_t Hour, uint8_t Min, uint8_t Sec)

This function switches off the display.

Example:

Rtc.writeDateTime();

Download

Version: 5.2
© 1996-2024 by Stefan Trippler (stef2024@[REM0VE]trippler.de)
Impressum

Valid HTML 4.01 Strict Valid CSS