mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
scripts/examples: Fix IMXRT deepsleep and stop examples.
This commit is contained in:
parent
c62f6d6dd0
commit
a2db9b35a6
@ -34,7 +34,7 @@ sensor.shutdown(True)
|
|||||||
|
|
||||||
# Enable RTC interrupts every 30 seconds.
|
# Enable RTC interrupts every 30 seconds.
|
||||||
# Note the camera will RESET after wakeup from Deepsleep Mode.
|
# Note the camera will RESET after wakeup from Deepsleep Mode.
|
||||||
rtc.wakeup(30000)
|
rtc.alarm(rtc.ALARM0, 30000)
|
||||||
|
|
||||||
# Enter Deepsleep Mode.
|
# Enter Deepsleep Mode.
|
||||||
machine.deepsleep()
|
machine.deepsleep()
|
||||||
|
|||||||
@ -5,11 +5,10 @@
|
|||||||
# Stop Mode Example
|
# Stop Mode Example
|
||||||
# This example demonstrates using the low-power Stop Mode.
|
# This example demonstrates using the low-power Stop Mode.
|
||||||
|
|
||||||
import pyb
|
|
||||||
import machine
|
import machine
|
||||||
|
|
||||||
# Create and init RTC object.
|
# Create and init RTC object.
|
||||||
rtc = pyb.RTC()
|
rtc = machine.RTC()
|
||||||
# (year, month, day[, hour[, minute[, second[, microsecond[, tzinfo]]]]])
|
# (year, month, day[, hour[, minute[, second[, microsecond[, tzinfo]]]]])
|
||||||
rtc.datetime((2014, 5, 1, 4, 13, 0, 0, 0))
|
rtc.datetime((2014, 5, 1, 4, 13, 0, 0, 0))
|
||||||
|
|
||||||
@ -17,8 +16,8 @@ rtc.datetime((2014, 5, 1, 4, 13, 0, 0, 0))
|
|||||||
print(rtc.datetime())
|
print(rtc.datetime())
|
||||||
|
|
||||||
# Enable RTC interrupts every 5 seconds.
|
# Enable RTC interrupts every 5 seconds.
|
||||||
rtc.wakeup(5000)
|
rtc.alarm(rtc.ALARM0, 5000)
|
||||||
|
|
||||||
# Enter Stop Mode.
|
# Enter Stop Mode.
|
||||||
# Note the IDE will disconnect.
|
# Note the IDE will disconnect.
|
||||||
machine.sleep()
|
machine.deepsleep()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user