mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Add sensor sleep mode example.
This commit is contained in:
parent
9b063127ac
commit
2f32dad550
11
usr/examples/19-Low-Power/sensor_sleep.py
Normal file
11
usr/examples/19-Low-Power/sensor_sleep.py
Normal file
@ -0,0 +1,11 @@
|
||||
# Sensor Sleep Mode Example.
|
||||
# This example demonstrates the sensor sleep mode. The sleep mode saves around
|
||||
# 40mA when enabled and it's automatically cleared when calling sensor reset().
|
||||
|
||||
import sensor, image, time
|
||||
|
||||
sensor.reset() # Reset and initialize the sensor.
|
||||
sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE)
|
||||
sensor.set_framesize(sensor.QVGA) # Set frame size to QVGA (320x240)
|
||||
sensor.skip_frames(time = 3000) # Capture frames for 3000ms.
|
||||
sensor.sleep(True) # Enable sensor sleep mode (saves about 40mA).
|
||||
Loading…
Reference in New Issue
Block a user