Skip to content

Commit

Permalink
Fixed DS3231 begin Issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
cvmanjoo committed Dec 11, 2024
1 parent 0927fb5 commit 6985ec2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=RTC
version=1.9.0
version=1.9.1
author=Manjunath CV
maintainer=Manjunath CV <cvmanjoo@gmail.com>
sentence=Library for I2C based RTCs (DS1307, DS3231, PCF8563, PCF8523, MCP7940).
Expand Down
10 changes: 9 additions & 1 deletion src/DS3231.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,18 @@
#include <Wire.h>
#include <I2C_RTC.h>

uint8_t DS3231::begin()
{
Wire.begin();
return(DS3231_ADDR);
//Wire.endTransmission();
}


bool DS3231::isConnected()
{
Wire.begin(); // join i2c bus
Wire.beginTransmission(0x68);
Wire.beginTransmission(DS3231_ADDR);
return (Wire.endTransmission() == 0 ? true : false);
}

Expand Down
5 changes: 4 additions & 1 deletion src/I2C_RTC.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class DS1307
//DS1307();

uint8_t begin();

bool isConnected();
bool isRunning();

Expand Down Expand Up @@ -167,9 +168,11 @@ class NVRAM
class DS3231 {

public:
uint8_t begin();

bool isConnected();

bool isRunning();

void startClock();
void stopClock();

Expand Down

0 comments on commit 6985ec2

Please # to comment.