import pyb, machine, sensor

# 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())

sensor.reset()

# Enable sensor softsleep
sensor.sleep(True)

# Optionally bypass the regulator on OV7725
# for the lowest possible power consumption.
if (sensor.get_id() == sensor.OV7725):
    # Bypass internal regulator
    sensor.__write_reg(0x4F, 0x18)

# Shutdown the sensor (pulls PWDN high).
sensor.shutdown(True)

# Enable RTC interrupts every 30 seconds.
# Note the camera will RESET after wakeup from Deepsleep Mode.
rtc.wakeup(30000)

# Enter Deepsleep Mode.
machine.deepsleep()

import pyb, machine, sensor

# 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())

sensor.reset()

# Shutdown the sensor (pulls PWDN high).
sensor.shutdown(True)

# Enable RTC interrupts every 30 seconds.
# Note the camera will RESET after wakeup from Deepsleep Mode.
rtc.wakeup(30000)

# Enter Deepsleep Mode.
machine.deepsleep()

Remove sensor setting from deep sleep example
Remove sensor setting from deep sleep example

  import pyb, machine, sensor
  
  # 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())
  
  sensor.reset()
  
- # Enable sensor softsleep
- sensor.sleep(True)
- 
- # Optionally bypass the regulator on OV7725
- # for the lowest possible power consumption.
- if (sensor.get_id() == sensor.OV7725):
-     # Bypass internal regulator
-     sensor.__write_reg(0x4F, 0x18)
- 
  # Shutdown the sensor (pulls PWDN high).
  sensor.shutdown(True)
  
  # Enable RTC interrupts every 30 seconds.
  # Note the camera will RESET after wakeup from Deepsleep Mode.
  rtc.wakeup(30000)
  
  # Enter Deepsleep Mode.
  machine.deepsleep()
  
Remove sensor setting from deep sleep example
## Code Before:
import pyb, machine, sensor

# 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())

sensor.reset()

# Enable sensor softsleep
sensor.sleep(True)

# Optionally bypass the regulator on OV7725
# for the lowest possible power consumption.
if (sensor.get_id() == sensor.OV7725):
    # Bypass internal regulator
    sensor.__write_reg(0x4F, 0x18)

# Shutdown the sensor (pulls PWDN high).
sensor.shutdown(True)

# Enable RTC interrupts every 30 seconds.
# Note the camera will RESET after wakeup from Deepsleep Mode.
rtc.wakeup(30000)

# Enter Deepsleep Mode.
machine.deepsleep()

## Instruction:
Remove sensor setting from deep sleep example
## Code After:
import pyb, machine, sensor

# 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())

sensor.reset()

# Shutdown the sensor (pulls PWDN high).
sensor.shutdown(True)

# Enable RTC interrupts every 30 seconds.
# Note the camera will RESET after wakeup from Deepsleep Mode.
rtc.wakeup(30000)

# Enter Deepsleep Mode.
machine.deepsleep()
