Turning on the camera instantly from sleep mode

OpenMV related project discussion.
gabriel_colon32
Posts: 2
Joined: Mon Oct 05, 2020 12:19 pm

Turning on the camera instantly from sleep mode

Postby gabriel_colon32 » Thu Oct 08, 2020 2:38 am

Greetings, I was wondering if it was possible for the camera to be turned on immedietly from sleep mode from the library without specifying a given repeated time. To put you in perspective, I am working on a project where rover drone must be launched from a rocket and when it lands safely, the camera must be turned on and start taking phothos.

Thanks in advance.
User avatar
kwagyeman
Posts: 4551
Joined: Sun May 24, 2015 2:10 pm

Re: Turning on the camera instantly from sleep mode

Postby kwagyeman » Thu Oct 08, 2020 12:36 pm

Yes, it’s possible, you need to record all relevant registers on the camera and reload them on turn on. I don’t know exactly what register settings you need to modify however.
Nyamekye,
User avatar
iabdalkader
Posts: 1229
Joined: Sun May 24, 2015 3:53 pm

Re: Turning on the camera instantly from sleep mode

Postby iabdalkader » Fri Oct 16, 2020 12:49 pm

You can also use extint to wake up from sleep mode:

Code: Select all

import time, pyb, machine
from pyb import Pin, ExtInt

def callback(line):
    pass

led = pyb.LED(3)
pin = Pin("P5", Pin.IN, Pin.PULL_UP)
ext = ExtInt(pin, ExtInt.IRQ_FALLING, Pin.PULL_UP, callback)

# Enter Stop Mode. Note the IDE will disconnect.
machine.sleep()

while (True):
    led.on()
    time.sleep(100)
    led.off()
    time.sleep(100)

Return to “Project Discussion”

Who is online

Users browsing this forum: No registered users and 0 guests