logo

深度休眠可以用外部信号唤醒吗?

2022-05-18 18:08
S
飞吧托利
96aa44b0-2b3d-4edb-b212-0630903eded9.png

如果machine.deepsleep([time_ms])不指定time_ms,可以通过外部信号的上升沿这种方法唤醒吗,另外想知道machine.lightsleep([time_ms])、machine.deepsleep([time_ms])这两种休眠模式的功耗分别是多少?

2022-05-18 21:16
I
网红小智智 星瞳科技

把下面的代码复制到OpenMV的SD卡中。

上电后会不亮灯,进入休眠模式,等你把P0引脚和GND连接,会唤醒,并亮红灯。

import machine
from pyb import LED

red_led   = LED(1)
green_led = LED(2)
blue_led  = LED(3)

p = machine.Pin('P0', machine.Pin.IN, machine.Pin.PULL_UP)
p.irq(trigger=machine.Pin.IRQ_RISING, handler=lambda p:None)

red_led.off()
green_led.off()
blue_led.off()

machine.sleep()

red_led.on()
green_led.off()
blue_led.off()

while True:
    pass
2022-05-19 15:25
S
飞吧托利

你好,在提供的中文文档中并没有对machine.sleep()这个函数进行介绍,只是提到不建议使用此函数,我想问的是深度休眠即machine.deepsleep()该如何唤醒?

2f8dbc60-1c02-4420-b4da-503fcac00162.png
2022-05-19 21:54
I
网红小智智 星瞳科技

@m1aw 在 [深度休眠可以用外部信号唤醒吗?](/post/25921) 中说:

> 道machine.lightsleep([time_ms])、machine.deepsleep([time_ms])这两种休眠模式的功耗分别是多少?

功耗的数据:

https://forums.openmv.io/t/latest-power-consumption-numbers/2205

I
网红小智智 星瞳科技

@m1aw 在 [深度休眠可以用外部信号唤醒吗?](/post/25937) 中说:

> machine.deepsleep()该如何唤醒

deepsleep只能通过RTC唤醒,不能通过引脚唤醒。