Merge pull request #2589 from kwagyeman/kwabena/update_sleep_examples

scripts/examples: Fix IMXRT deepsleep and stop examples.
This commit is contained in:
Ibrahim Abdelkader 2025-01-30 20:19:25 +02:00 committed by GitHub
commit 54ddfbb892
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 5 deletions

View File

@ -34,7 +34,7 @@ sensor.shutdown(True)
# Enable RTC interrupts every 30 seconds.
# Note the camera will RESET after wakeup from Deepsleep Mode.
rtc.wakeup(30000)
rtc.alarm(rtc.ALARM0, 30000)
# Enter Deepsleep Mode.
machine.deepsleep()

View File

@ -5,11 +5,10 @@
# Stop Mode Example
# This example demonstrates using the low-power Stop Mode.
import pyb
import machine
# Create and init RTC object.
rtc = pyb.RTC()
rtc = machine.RTC()
# (year, month, day[, hour[, minute[, second[, microsecond[, tzinfo]]]]])
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())
# Enable RTC interrupts every 5 seconds.
rtc.wakeup(5000)
rtc.alarm(rtc.ALARM0, 5000)
# Enter Stop Mode.
# Note the IDE will disconnect.
machine.sleep()
machine.deepsleep()