When I change the timetable, the year is updated with 48 years more.
To make it work I modified DS1307 :: updtDate () but I don't understand why.
void DS1307::updtDate()
{ m_clock.m_date.setDate( bcdToDec(m_data[6]-48), bcdToDec(m_data[5]), bcdToDec(m_data[4]) ); }
If I use this method of the DS1307 library to read register 7, then I can no longer write to register 7.
Ds1307SqwPinMode mode = rtc.readSqwPinMode();
ds1307SqwPin.ino (use method to read register 7 doesn't work)
ds1307SqwPin1.ino (does not use method to read register 7 works)
I attach files for testing.
Greetings
To make it work I modified DS1307 :: updtDate () but I don't understand why.
void DS1307::updtDate()
{ m_clock.m_date.setDate( bcdToDec(m_data[6]-48), bcdToDec(m_data[5]), bcdToDec(m_data[4]) ); }
If I use this method of the DS1307 library to read register 7, then I can no longer write to register 7.
Ds1307SqwPinMode mode = rtc.readSqwPinMode();
ds1307SqwPin.ino (use method to read register 7 doesn't work)
ds1307SqwPin1.ino (does not use method to read register 7 works)
I attach files for testing.
Greetings
- Attachments
- Ds1307.zip
- You don't have permission to download attachments.
- (6 Kb) Downloaded 4 times
Last edited by arcachofo on Wed Jan 12, 2022 10:39 pm; edited 1 time in total (Reason for editing : Marked as solved (green color))