想利用udp协议把openmv看到的图像传输到电脑端,请问有相关函数可以实现嘛?
5
5ayx
@5ayx
0
声望
9
楼层
674
资料浏览
0
粉丝
0
关注
5ayx 发布的帖子
-
OPENMV的CAN 通讯初始化问题
历程上说CAN的初始化有两种办法。
第一种:can = CAN(2, CAN.NORMAL, baudrate=250_000, sampling_point=75
第二种:can.init(pyb.CAN.NORMAL, prescaler=16, sjw=2, bs1=7, bs2=3) #250kb/s
但是我用第一种方法进行初始化后可以正常通讯,用第二种办法的时候无法进行通讯,想问问是怎么回事呢?(因为第一种办法没办法设置波特率为800kBps,所以我需要第二种方法自己设置参数使得波特率为800# CAN Shield Example # # This example demonstrates CAN communications between two cameras. # NOTE: you need two CAN transceiver shields and DB9 cable to run this example. import pyb import time, omv from pyb import CAN # NOTE: Set to False on receiving node. TRANSMITTER = False #can = pyb.CAN(2) can = CAN(2, CAN.NORMAL, baudrate=250_000, sampling_point=75) #can.init(pyb.CAN.NORMAL, prescaler=16, sjw=2, bs1=7, bs2=3) #250kb/s # NOTE: uncomment to set bit timing manually, for example: #can.init(CAN.NORMAL,prescaler=18, sjw=1, bs1=8, bs2=3) can.restart() if (TRANSMITTER): while (True): # Send message with id 1 can.send('Hello', 1) time.sleep_ms(1000) else: # Runs on the receiving node. if (omv.board_type() == 'H7'): # FDCAN # Set a filter to receive messages with id=1 -> 4 # Filter index, mode (RANGE, DUAL or MASK), FIFO (0 or 1), params can.setfilter(0, CAN.RANGE, 0, (1, 1638)) else: # Set a filter to receive messages with id=1, 2, 3 and 4 # Filter index, mode (LIST16, etc..), FIFO (0 or 1), params can.setfilter(0, CAN.LIST16, 0, (1, 2, 3, 4)) while (True): # Receive messages on FIFO 0 #print(can.any(0)) message =can.recv(0, timeout=10000) messagetex = message[3] if (messagetex[0] == 0x01 ): print(123) else: print(message) # print(can.any(0))
)