diff options
| author | Daniel Thompson <daniel@redfelineninja.org.uk> | 2020-02-01 13:42:11 (GMT) |
|---|---|---|
| committer | Daniel Thompson <daniel@redfelineninja.org.uk> | 2020-02-01 13:42:11 (GMT) |
| commit | fed9c58205c6a5c81d150b49bc9b6aebe18f5aa0 (patch) | |
| tree | f2a7818f78cb70e6e337c0a760f9231cfd9429a5 /wasp/boards/pinetime | |
| parent | a70f82cf74a62f4774182f97c01fbb0225d87943 (diff) | |
wasp: pinetime: Start an RTC at board board
Diffstat (limited to 'wasp/boards/pinetime')
| -rw-r--r-- | wasp/boards/pinetime/watch.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/wasp/boards/pinetime/watch.py b/wasp/boards/pinetime/watch.py index 0d0fa4b..d6a8210 100644 --- a/wasp/boards/pinetime/watch.py +++ b/wasp/boards/pinetime/watch.py @@ -1,4 +1,5 @@ from machine import Pin +from machine import RTCounter as RTC #from machine import Signal from machine import SPI @@ -12,7 +13,7 @@ class Display(ST7789_SPI): spi = SPI(0) # Mode 3, maximum clock speed! spi.init(polarity=1, phase=1, baudrate=8000000) - + # Configure the display cs = Pin("DISP_CS", Pin.OUT) dc = Pin("DISP_DC", Pin.OUT) @@ -48,6 +49,10 @@ backlight = Backlight(0) display = Display() backlight.set(1) +# Start measuring time (and feeding the watchdog) +rtc = RTC(1, mode=RTC.PERIODIC) +rtc.start() + battery = Battery( Pin('BATTERY', Pin.IN), Signal(Pin('CHARGING', Pin.IN), invert=True), |
