We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f8477d9 commit 25f60d9Copy full SHA for 25f60d9
draft_code/timers.py
@@ -0,0 +1,11 @@
1
+from machine import Timer
2
+
3
+# Callback function to be executed periodically
4
+def timer_callback(timer):
5
+ print("Timer 500 triggered!")
6
7
+# Initialize a timer
8
+timer = Timer(500) # Must be 0-20 on unix/desktop
9
10
+# Set up a periodic timer (e.g., trigger every 1000ms)
11
+timer.init(period=1000, mode=Timer.PERIODIC, callback=timer_callback)
internal_filesystem/lib/mpos/time.py
@@ -0,0 +1,10 @@
+import time
+def epoch_seconds():
+ import sys
+ if sys.platform == "esp32":
+ # on esp32, it needs this correction:
+ return time.time() + 946684800
+ else:
+ return round(time.time())
0 commit comments