系统迁移中,暂时无法访问,所有数据会迁移到新的网站。
OpenMV VSCode 扩展发布了,在插件市场直接搜索OpenMV就可以安装
如果有产品硬件故障问题,比如无法开机,论坛很难解决。可以直接找售后维修。
发帖子之前,请确认看过所有的视频教程,https://singtown.com/learn/ 和所有的上手教程http://book.openmv.cc/
每一个新的提问,单独发一个新帖子
帖子需要目的,你要做什么?
如果涉及代码,需要报错提示与全部代码文本,请注意不要贴代码图片
必看:玩转星瞳论坛了解一下图片上传,代码格式等问题。
部分代码,为什么电脑接收不到圆的坐标?
-
uart = UART(3, 115200) for c in img.find_circles(threshold = 3500, x_margin = 10, y_margin = 10, r_margin = 10,r_min = 2, r_max = 100, r_step = 2): img.draw_circle(c.x(), c.y(), c.r(), color = (255, 0, 0)) print(c) print("FPS %f" % clock.fps()) uart.init(115200, bits=8, parity=None, stop=1) # init with given parameters def send_data_packet(x,y,z,w): #frame=[0x2C,18,cx%0xff,int(cx/0xff),cy%0xff,int(cy/0xff),0x5B]; #data = bytearray(frame) data = ustruct.pack("<bbhhhhb", #格式为俩个字符俩个短整型(2字节) 0x2C, #帧头1 0x12, #帧头2 int(cx), # up sample by 4 #数据1 int(cy), # up sample by 4 #数据2 int(cw), # up sample by 4 #数据1 int(ch), # up sample by 4 #数据2 0x5B) uart.write(data);data_out = json.dumps(set(data)) while(True): clock.tick() date=bytearray[(1,2,3,4,5)] uart.write(data) img = sensor.snapshot() c = img.find_circles() cx=0;cy=0; if c: c = find_circles(c) cx=c.x() cy=c.y() cw=c.r() ch=c.magnitude() img.draw_circle(c.x(), c.y(), c.r(), color = (255, 0, 0)) FH = bytearray([0x2C,0x12,cx,cy,cw,ch,0x5B]) #sending_data(cx,cy,cw,ch) uart.write(FH) print(cx,cy,cw,ch)
请在这里粘贴代码
-
电脑端什么都没接到,还是格式错误?
-
代码就是上面那些,电脑上啥都没没收到,您看看是不是哪里写错了,新手小白,求指导。
请在这里粘贴代码
-
这个是识别到了圆,串行终端有代码输出,就是通过串口发不到电脑上
-
-
这个代码能发出来
-
uart = UART(3, 115200) uart.init(115200, bits=8, parity=None, stop=1) # init with given parameters def send_data_packet(x,y,z,w): #frame=[0x2C,18,cx%0xff,int(cx/0xff),cy%0xff,int(cy/0xff),0x5B]; #data = bytearray(frame) data = ustruct.pack("<bbhhhhb", #格式为俩个字符俩个短整型(2字节) 0x2C, #帧头1 0x12, #帧头2 int(cx), # up sample by 4 #数据1 int(cy), # up sample by 4 #数据2 int(cw), # up sample by 4 #数据1 int(ch), # up sample by 4 #数据2 0x5B) uart.write(data);data_out = json.dumps(set(data)) while(True): clock.tick() date=bytearray[(1,2,3,4,5)] uart.write(data) time.sleep(1)
运行这个测试。