Hi, I’m very much a newbie to Python and while I have some Arduino experience, I’ve ran into enough stumbling blocks that suggest I’ve fundamentally misunderstood something. I’m trying to use an RV3028 RTC board with a Badger 2040 running Micropython v1.19.6, the RTC is connected through the QW/ST connector, and I’ve been using Thonny to run some sketches on the Badger without issue. I’ve installed the rv3028 library v0.0.5 in Thonny, along with smbus2 v0.4.2 and i2cdevice v0.0.7 (all through the PyPI package manager).
My first problem is running the example ‘set-time.py’ sketch, as the compiler reports ImportError: no module named ‘datetime’. It seems to be a requirement of the rv3028 library that’s not included? I wasn’t able to find a “datetime” module in PyPI that actually installed, as the only one (DateTime) says it’s not a Micropython package. I see a number of other examples import a module called rv3028_rtc but that doesn’t appear in PyPI or the Pimoroni Github.
- The RV3028 is supposed to be compatible, so when the example sketch fails, what have I missed?
My next question is in the interfacing to the Badger itself. I know that to use the RV3028 with the Badger (and indeed to actually set the time in the first place) I’ve connected the RV3028 to the Badger using the QW/ST connector on the back, and I’ll import the rv2038 module in the sketch running in the Badger.
- Do I not need to define the pins that the Badger uses for the QWST? Or how does the Badger know where to find the RV3028?
- The circuit diagram shows the I2C interface on pins 6 and 7 of the 2040 chip, what are their logical names in the Badger2040 class? They’re not listed here pimoroni-pico/micropython/modules/badger2040 at main · pimoroni/pimoroni-pico · GitHub
Thanks in advance. I’m sure I must be missing some obvious things because I see so many people making such awesome things and can’t believe they’re all falling at the first hurdle like me.