Time if times

RP2040 based microcontroller boards running MicroPython.
Target audience: MicroPython users with an RP2040 boards.
This does not include conventional Linux-based Raspberry Pi boards.
tonygo
Posts: 10
Joined: Thu Apr 12, 2018 1:23 pm

Re: Time if times

Post by tonygo » Tue Nov 16, 2021 3:10 pm

You may find this us use
https://www.instructables.com/Pi-Pico-R ... 1-Workout/
Please let me know if it helps.
Tony Goodhew

User avatar
scruss
Posts: 360
Joined: Sat Aug 12, 2017 2:27 pm
Location: Toronto, Canada
Contact:

Re: Time if times

Post by scruss » Tue Nov 16, 2021 4:31 pm

deatz wrote:
Tue Nov 16, 2021 3:01 am
I am using Thonny, though it's become a bit quirky with the last update. At any rate. just run this once and then after it is unplugged and replugged with another source it'll have it's own correct time?
It should, if the battery / supercap / power supply is working in your DS3231.
karfas wrote:
Tue Nov 16, 2021 7:22 am
scruss' code above sets the DS3231 to system time, not the other way around.
Yes, that's what it does. Note that the Pico's machine.RTC and the DS3231 have different ideas of what day of week = 0 should be. Also, the RTCs' data structure and utime.localtime()'s return structure are different.

deatz
Posts: 10
Joined: Mon Oct 04, 2021 8:57 pm

Re: Time if times

Post by deatz » Wed Nov 17, 2021 10:50 pm

Bingo!! A few tweaks and we seem to be in business!

Thanks to all for your patience and help!

Now for a new project....

DeatZ

Post Reply