openmv/scripts/examples/Arduino/19-Low-Power/stop_mode.py
iabdalkader 5a6b4b2f1c Update Examples.
* Move examples to sub dirs.
* Add Arduino examples dir.
2020-11-16 23:03:02 +02:00

20 lines
438 B
Python

# Stop Mode Example
# This example demonstrates using the low-power Stop Mode.
import time, pyb, machine
# Create and init RTC object.
rtc = pyb.RTC()
# (year, month, day[, hour[, minute[, second[, microsecond[, tzinfo]]]]])
rtc.datetime((2014, 5, 1, 4, 13, 0, 0, 0))
# Print RTC info.
print(rtc.datetime())
# Enable RTC interrupts every 5 seconds.
rtc.wakeup(5000)
# Enter Stop Mode.
# Note the IDE will disconnect.
machine.sleep()