展旗(图一) 粮仓(图二) 主要代码

#Display the flag
'''

c.move([0,0,0,0,30,0,0,0])
time.sleep(1.25)
c.move([0,0,0,0,0,0,0,0])
time.sleep(5)

c.move([0,0,0,0,30,0,0,0])
time.sleep(1.25)
c.move([0,0,0,0,0,0,0,0])
'''

#Drop ball program
'''
c.move([0,0,0,0,0,10,0,0])
time.sleep(1.5)#1~1.7
c.move([0,0,0,0,0,-40,0,0])
time.sleep(2)
'''

#move函数
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
send_data_21_motor = comma_head_21_motor + m1.to_bytes(1, byteorder='big', signed=True) + comma_trail
send_data_22_motor = comma_head_22_motor + m2.to_bytes(1, byteorder='big',signed=True) + comma_trail
send_data_23_motor = comma_head_23_motor + m3.to_bytes(1, byteorder='big', signed=True) + comma_trail
send_data_24_motor = comma_head_24_motor + m4.to_bytes(1, byteorder='big', signed=True) + comma_trail

self.serial.write(send_data_01_motor)
self.serial.write(send_data_02_motor)
self.serial.write(send_data_03_motor)
self.serial.write(send_data_04_motor)

self.serial.write(send_data_21_motor)
self.serial.write(send_data_22_motor)
self.serial.write(send_data_23_motor)
self.serial.write(send_data_24_motor)

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值