# Deepsleep Mode Example
# This example demonstrates using the low-power Deepsleep Mode.
# Note the camera will reset after wake-up from deep sleep. To find out if the cause of reset
# is deep sleep, call the machine.reset_cause() function and test for machine.DEEPSLEEP_RESET
import 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.
# Note the camera will RESET after wakeup from Deepsleep Mode.
rtc.wakeup(5000)

# Enter Deepsleep Mode.
machine.deepsleep()

@@ -1,19 +1,20 @@
 # Deep
-s
+ S
 leep Mode Ex
@@ -51,14 +51,8 @@
 tes 
-using 
 the 
@@ -61,30 +61,52 @@
 w-power 
-D
+d
 eep
+ 
 sleep 
-M
+m
 ode
+ plus sensor shutdown
 .%0A# Note
@@ -306,16 +306,24 @@
  machine
+, sensor
 %0A%0A# Crea
@@ -522,16 +522,337 @@
 ime())%0A%0A
+sensor.reset()%0A# Optionally bypass the regulator on OV7725%0A# for the lowest possible power consumption.%0Aif (sensor.get_id() == sensor.OV7725):%0A    # Bypass internal regulator%0A    sensor.__write_reg(0x4F, 0x18)%0A%0A# Enable sensro softsleep%0Asensor.sleep(True)%0A%0A# Shutdown the sensor (pulls PWDN high).%0Asensor.shutdown(True)%0A%0A
 # Enable
@@ -873,17 +873,18 @@
 s every 
-5
+30
  seconds
@@ -959,17 +959,18 @@
 .wakeup(
-5
+30
 000)%0A%0A# 

Update deep sleep script.