kopia lustrzana https://github.com/peterhinch/micropython-samples
DS3231: Update README. Modify test for Pyboard D.
rodzic
e2fc55740e
commit
d8a1810a90
|
@ -28,10 +28,6 @@ local time (`utime.localtime()`) is based on the RTC time. Changes to local
|
|||
time don't propagate to the RTC which must explicitly be set. This holds for
|
||||
the Pyboard, ESP8266 and ESP32.
|
||||
|
||||
The official ESP32 port currently lacks support for the RTC so the Loboris port
|
||||
should be used for this purpose. The driver supports both but if the official
|
||||
port is used only the local time can be updated from the DS3231.
|
||||
|
||||
## 1.1 The DS3231 class
|
||||
|
||||
Constructor:
|
||||
|
|
|
@ -7,8 +7,13 @@
|
|||
from machine import Pin, I2C
|
||||
import utime
|
||||
import sys
|
||||
import uos
|
||||
from ds3231_port import DS3231
|
||||
|
||||
# If powering the DS3231 from a Pyboard D 3V3 output:
|
||||
if uos.uname().machine.split(' ')[0][:4] == 'PYBD':
|
||||
Pin.board.EN_3V3.value(1)
|
||||
|
||||
# A Pyboard test
|
||||
#from pyb import RTC
|
||||
#rtc = RTC()
|
||||
|
|
Ładowanie…
Reference in New Issue