1
13957730474
@13957730474
0
声望
23
楼层
1097
资料浏览
0
粉丝
0
关注
13957730474 发布的帖子
-
出现报错:像素格式不支持。
改成灰度也一样报错。前几分钟还连接成功,没有报错,但是刚刚就突然报错了,是什么问题呢?怎么解决呢?
附上代码:import sensor, image, time from pyb import RTC, Pin, Timer sensor.reset() # Reset and initialize the sensor. sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE) sensor.set_framesize(sensor.QVGA) # Set frame size to QVGA (320x240) sensor.skip_frames(time = 2000) # Wait for settings take effect. #定时 def tick(timer): # we will receive the timer object when being called print("Timer callback") tim = Timer(4, freq=0.1) # create a timer object using timer 4 - trigger at 1Hz tim.callback(tick) # set the callback to our tick function #时钟 #rtc = RTC() #rtc.datetime()#(2018, 5, 11, 5, 9, 22, 0, 0) while(True): img = sensor.snapshot() # print(rtc.datetime()) time.sleep(1000)
发现其他代码也报错