for now this will have to do

if 0 <= wd <= 3 or wd == 6
If this is any help the fixes I have had working for a while now might help -pythoncoder wrote: ↑Sat Oct 09, 2021 9:48 amYou seem to have found a bug there. On a Pyboard, on the Unix build and on CPython the day of the week is 5 (Saturday, with 0 being Monday). On the Pico it is 4.
I have raised this issue.
So what have you tried? What DS3231 module have you got?deatz wrote: ↑Sat Oct 30, 2021 3:36 pmI have searched and searched and I cannot seem to find a good tutorial on the installation/setup of a DS3231 unit with the Pico. I have found a good one for a regular Pi but, in my mind at least, it isn't translating. The only decent one for a Pico I've found so far has such poor English I cannot follow it and there is no documentation.
Code: Select all
MicroPython v1.17 on 2021-09-02; Raspberry Pi Pico with RP2040
Type "help()" for more information.
>>> from machine import Pin, I2C
>>> i2c=I2C(0, scl=Pin(17), sda=Pin(16))
>>> i2c.scan()
[104]
Code: Select all
# ds3231_port_test
# Test/demo of portable driver for DS3231 precision RTC chip
# pro micro rp2040, ds3231 on qwiic port
# cut down a bunch - scruss, 2021,11
# (original) Author: Peter Hinch
# Copyright Peter Hinch 2018 Released under the MIT license
from machine import Pin, I2C
import utime
from ds3231_port import DS3231
i2c=I2C(0, scl=Pin(17), sda=Pin(16))
ds3231 = DS3231(i2c)
print('Initial values')
print('DS3231 time:', ds3231.get_time())
print('RTC time: ', utime.localtime())
print('Setting DS3231 from RTC')
ds3231.save_time() # Set DS3231 from RTC
print('DS3231 time:', ds3231.get_time())
print('RTC time: ', utime.localtime())