|
@@ -0,0 +1,23 @@
|
|
|
+"""
|
|
|
+tested on uiflow for stickc v1.8.1
|
|
|
+"""
|
|
|
+
|
|
|
+
|
|
|
+import m5ui
|
|
|
+import machine
|
|
|
+from m5stack import lcd, axp
|
|
|
+
|
|
|
+print("battery:", axp.getBatVoltage(), "V")
|
|
|
+
|
|
|
+m5ui.setScreenColor(0x000000)
|
|
|
+screen_width, screen_height = lcd.winsize()
|
|
|
+
|
|
|
+time_text_box = m5ui.M5TextBox(
|
|
|
+ screen_width - 1, 0, "HH:MM", lcd.FONT_DejaVu40, 0xFFFFFF, rotate=90
|
|
|
+)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+rtc = machine.RTC()
|
|
|
+time_text_box.setText("{}:{}".format(*rtc.datetime()[4:6]))
|