edg驱动 wobot通过ttyUSB0串口通信

舵机: 77 68 06 00 02 36 03 50 E3 0A //舵机 逆时针变小,顺时针变大;(-60~-100)(C4,9C)
77 68 06 00 02 36 03 10 C4 0A #-60度位置
77 68 06 00 02 36 03 10 9C 0A #-100度位置

port
触碰开关: 77 68 04 00 01 DD 01 0A
port color

rgb灯:77 68 08 00 02 3B 02 01 FF FF FF 0A

蜂鸣器:77 68 06 00 02 3D 03 02 0A

超声测距传感器:77 68 04 00 01 D1 01 0A

按键开关://77 68 05 00 01 DB 01 01 0A
77 68 05 00 01 E1 01 01 0A


编码电机指令:
77 68 06 00 02 0C 01 01 50 0A
77 68 06 00 02 0C 01 01 00 0A

comma_head_01_motor = bytes.fromhex('77 68 06 00 02 0C 01 01')
comma_head_02_motor = bytes.fromhex('77 68 06 00 02 0C 01 02')
comma_head_03_motor = bytes.fromhex('77 68 06 00 02 0C 01 03')
comma_head_04_motor = bytes.fromhex('77 68 06 00 02 0C 01 04')
comma_trail = bytes.fromhex('0A')

portx = "/dev/ttyUSB0"
bps = 115200

send_data_01_motor = comma_head_01_motor + left_front.to_bytes(1, byteorder='big', signed=True) + comma_trail
send_data_02_motor = comma_head_02_motor + right_front.to_bytes(1, byteorder='big', signed=True) + comma_trail
send_data_03_motor = comma_head_03_motor + left_rear.to_bytes(1, byteorder='big', signed=True) + comma_trail
send_data_04_motor = comma_head_04_motor + right_rear.to_bytes(1, byteorder='big', signed=True) + comma_trail

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值