Page 1 of 1

Turning on the camera instantly from sleep mode

Posted: Thu Oct 08, 2020 2:38 am
by gabriel_colon32
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.

Re: Turning on the camera instantly from sleep mode

Posted: Thu Oct 08, 2020 12:36 pm
by kwagyeman
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.

Re: Turning on the camera instantly from sleep mode

Posted: Fri Oct 16, 2020 12:49 pm
by iabdalkader
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)