openmv怎么控制syn6288模块
-
import sensor, image, time
from pyb import UARTuart = UART(3, 9600)
hzdata_y=[0xC2,0xCC,0xC2,0xEB,0xBB,0xB6,0xD3,0xAD,0xB3,0xCB,0xB3,0xB5];
hzdata_n=[0xD7,0xB4,0xCC,0xAC,0xD2,0xEC,0xB3,0xA3];
sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.skip_frames(time = 2000)clock = time.clock()
while(True):
clock.tick()
img = sensor.snapshot()
print(clock.fps())
uart.write(bytearray(hzdata_y))
uart.write("你好")
time.sleep(3)
print(bytearray(hzdata_y))在另一个单片机上可发声,想说的话转成了16进制发送,不知道什么原因openmv控制不了。
-
你这个协议不对啊,我看SYN6288E数据手册上是0XFD是帧头。
你是按照数据手册编写的协议吗?
-
@zn4s 大佬实现了吗
-
@kidswong999 谢谢,你提醒了我
-
@k5r1 # Untitled - By: 49053 - 周四 5月 12 2022
import sensor, image, time
from pyb import UARTuart = UART(3, 9600)
hzdata=[0xfd,0x00,15,0x01,(0x01|(1<<4)),0xC2,0xCC,0xC2,0xEB,0xBB,0xB6,0xD3,0xAD,0xB3,0xCB,0xB3,0xB5];
hzdata_n=[0xD7,0xB4,0xCC,0xAC,0xD2,0xEC,0xB3,0xA3];
ecc=0
for i in hzdata:
ecc=ecc^i
hzdata_y=[0xfd,0x00,15,0x01,(0x01|(1<<4)),0xC2,0xCC,0xC2,0xEB,0xBB,0xB6,0xD3,0xAD,0xB3,0xCB,0xB3,0xB5,ecc]
sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.skip_frames(time = 2000)clock = time.clock()
while(True):
clock.tick()
img = sensor.snapshot()
print(clock.fps())
uart.write(bytearray(hzdata_y))
time.sleep(3)
print(bytearray(hzdata_y))其中0xC2,0xCC,0xC2,0xEB,0xBB,0xB6,0xD3,0xAD,0xB3,0xCB,0xB3,0xB5就是要说的话