DS3231 I2C real time clock.

Discuss development of drivers for external hardware and components, such as LCD screens, sensors, motor drivers, etc.
Target audience: Users and developers of drivers.
Post Reply
User avatar
gcarver
Posts: 34
Joined: Sun Oct 26, 2014 4:07 am
Location: New Market, Maryland
Contact:

DS3231 I2C real time clock.

Post by gcarver » Wed Feb 28, 2018 6:05 pm

End of line...

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: DS3231 I2C real time clock.

Post by pythoncoder » Thu Mar 01, 2018 8:00 am

Looks kinda familiar ;) If you look at my source you'll see that I have a policy of referencing sources when I adapt the code of others. No beef - just saying.

The above repo now includes a cross-platform version of this driver for those wishing to endow their ESP8266 with a decent RTC. The old Pyboard-only version is primarily for rapidly producing the calibration factors for the Pyboard RTC.
Peter Hinch
Index to my micropython libraries.

User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

Re: DS3231 I2C real time clock.

Post by deshipu » Thu Mar 01, 2018 1:37 pm

There is also the uRTC library that supports that chip: https://github.com/adafruit/Adafruit-uRTC

User avatar
gcarver
Posts: 34
Joined: Sun Oct 26, 2014 4:07 am
Location: New Market, Maryland
Contact:

Re: DS3231 I2C real time clock.

Post by gcarver » Thu Mar 01, 2018 3:15 pm

pythoncoder wrote:
Thu Mar 01, 2018 8:00 am
Looks kinda familiar ;) If you look at my source you'll see that I have a policy of referencing sources when I adapt the code of others. No beef - just saying.

The above repo now includes a cross-platform version of this driver for those wishing to endow their ESP8266 with a decent RTC. The old Pyboard-only version is primarily for rapidly producing the calibration factors for the Pyboard RTC.
Sorry about that, but it's a coincidence in this case. I adapted code but it was from an Arduino C version. We can remove this post if you'd like.
End of line...

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: DS3231 I2C real time clock.

Post by pythoncoder » Thu Mar 01, 2018 4:46 pm

gcarver wrote:
Thu Mar 01, 2018 3:15 pm
...Sorry about that, but it's a coincidence in this case. I adapted code but it was from an Arduino C version. We can remove this post if you'd like.
Sorry, but that is patently untrue.

Your code includes my entirely original work on rapidly determining Pyboard calibration values. That couldn't possibly have originated on Arduino. Laughably your code even includes comments I wrote detailing the measurements I took, illustrating that a calibration runtime of five minutes was sufficient. Compare yours with mine.

I don't actually mind. But some regard for the facts and perhaps the courtesy of attribution would help.
Peter Hinch
Index to my micropython libraries.

User avatar
gcarver
Posts: 34
Joined: Sun Oct 26, 2014 4:07 am
Location: New Market, Maryland
Contact:

Re: DS3231 I2C real time clock.

Post by gcarver » Thu Mar 01, 2018 6:00 pm

Wow pythoncoder,
I am truly sorry and I stand completely corrected. I don't make it a habit of writing code that already exists in usable form and don't recall even seeing your code. Please accept my apology. I will re-examine your implementation, and if it works for me I'll go so far as to remove my version and just use yours. If not, I'll add the correct reference to your work. Again, I'm very sorry.
End of line...

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: DS3231 I2C real time clock.

Post by pythoncoder » Fri Mar 02, 2018 7:04 am

That's fine, Guy, no problem.

There was no need to remove your code. I welcome forks, adaptations and especially PR's with bugfixes or enhancements. That's what open source is all about. My DS3231 driver was based on Dave Smith's WiPy-specific solution: see the credit in the code comments.
Peter Hinch
Index to my micropython libraries.

Post Reply