|
@@ -9,7 +9,7 @@ import m5ui
|
|
|
import machine
|
|
|
import micropython
|
|
|
import utils
|
|
|
-from m5stack import axp, btnA, lcd
|
|
|
+from m5stack import axp, btnA, btnB, lcd
|
|
|
|
|
|
FONT = lcd.FONT_DejaVu40
|
|
|
DEFAULT_FONT_COLOR = lcd.WHITE
|
|
@@ -79,7 +79,20 @@ def button_a_pressed():
|
|
|
micropython.schedule(update_menu, menu_position)
|
|
|
|
|
|
|
|
|
+def button_b_pressed():
|
|
|
+ global menu_position
|
|
|
+ if menu_position == 1:
|
|
|
+ alarm_time["hour"] += 1
|
|
|
+ alarm_hour_text_box.setText("{:02d}".format(alarm_time["hour"]))
|
|
|
+ elif menu_position == 2:
|
|
|
+ alarm_time["minute"] += 1
|
|
|
+ alarm_minute_text_box.setText("{:02d}".format(alarm_time["minute"]))
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
btnA.wasPressed(button_a_pressed)
|
|
|
+btnB.wasPressed(button_b_pressed)
|
|
|
|
|
|
|
|
|
|