logo

出现报错:像素格式不支持。

2018-05-11 09:54
Z
JS
895a9d71-e509-4794-ad69-f86c31b86548.png

改成灰度也一样报错。前几分钟还连接成功,没有报错,但是刚刚就突然报错了,是什么问题呢?怎么解决呢?

附上代码:

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)

发现其他代码也报错

727dcd93-dce3-4fc6-ad3b-ed3562ebab26.png
2018-05-11 10:18
X
Yuan

我用的最新版本固件(2.9.0)和ide(1.9.0)运行没有问题。

你升级到最新版固件和ide试一下。

X
Yuan

你是OpenMV2还是OpenMV3?

2018-05-11 10:29
Z
JS

ide是1.8.1的,正在下1.9.0

windows系统的是下这个吧

4f29a3a6-c0de-49bc-a0f8-9aa584a9e5b9.png
Z
JS

如果是OpenMV3就点文件夹OpenMV3是吗?

4dc11b23-3563-4770-9be4-a5bc6b9af93a.png
2018-05-11 11:13
I
网红小智智 星瞳科技

固件可以直接在IDE里面点一下升级,教程里都有

2018-05-11 12:27
Z
JS

升级了固件,可以正常使用了

2018-06-23 20:38
B
llllll

@kidswong999 我也有这个问题,不过更新了好几次固件都没反应,还有其他办法吗?

2018-06-23 22:39
X
Yuan

应该是中断冲突了,你运行hello world 应该是没问题的吧

2018-06-24 13:44
B
llllll
bf60e759-dacc-42dd-812f-24f31c49f8eb.png
I
网红小智智 星瞳科技

你要硬件重启(也就是重新拔数据线),然后直接运行hello world

2018-06-24 13:56
B
llllll

@kidswong999 这样可以运行hello world了。找到我程序的问题了,谢谢大佬~