logo

为什么定时器和拍照同时运行,程序会卡死?

2019-04-23 21:53
K
dx1g

import sensor, image, time

from pyb import Pin, Timer

sensor.reset()

sensor.set_pixformat(sensor.GRAYSCALE)

sensor.set_framesize(sensor.QVGA)

sensor.skip_frames(time = 2000)

clock = time.clock()

def tick(timer):

uart.write(uart)

print("111111")

tim = Timer(4, freq=1)

tim.callback(tick)

while (True):

img = sensor.snapshot()

0120bf42-d20a-4af7-aca5-27f438c00d38.png
a6136b02-3431-42b9-9d83-5f9df95fa754.png
f2f059c2-cd13-4bb0-864c-1c44791a9281.png
2019-04-24 09:57
I
网红小智智 星瞳科技

不要用中断函数,总会有莫名其妙的问题。

2019-04-24 20:14
K
dx1g

那我openmv中需要中断还有其他方法吗