如何实现连续拍照并且储存到sd卡中?完整一点的代码是否可以提供?
import sensor, image, time
sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.skip_frames(time = 2000)
clock = time.clock()
i=0
while(True):
clock.tick()
img = sensor.snapshot()
img.save(i+".jpg")
print(clock.fps())@kidswong999 在 [如何实现连续拍照并且储存到sd卡中?](/post/31366) 中说:
>
> import sensor, image, time
>
> sensor.reset()
> sensor.set_pixformat(sensor.RGB565)
> sensor.set_framesize(sensor.QVGA)
> sensor.skip_frames(time = 2000)
>
> clock = time.clock()
> i=0
> while(True):
> clock.tick()
> img = sensor.snapshot()
> img.save(i+".jpg")
> print(clock.fps())

不好意思,之前的代码没检查
import sensor, image, time
sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.skip_frames(time = 2000)
clock = time.clock()
i=0
while(True):
clock.tick()
img = sensor.snapshot()
img.save(str(i)+".jpg")
i+=1
print(clock.fps())