Commande PWM
This commit is contained in:
parent
3ae12eff48
commit
8fd6c07fc6
@ -67,6 +67,13 @@ def lecture_propulsion():
|
|||||||
if len(list_message[1])>25:
|
if len(list_message[1])>25:
|
||||||
struct_value = struct.unpack('ffffff',list_message[1][1:25])
|
struct_value = struct.unpack('ffffff',list_message[1][1:25])
|
||||||
return (struct_value[0],struct_value[1],struct_value[2], struct_value[3], struct_value[4], struct_value[5])
|
return (struct_value[0],struct_value[1],struct_value[2], struct_value[3], struct_value[4], struct_value[5])
|
||||||
|
|
||||||
|
def envoie_trajectoire(traj):
|
||||||
|
msg_envoi_donnees(b'P', 0x22, traj)
|
||||||
|
|
||||||
|
def envoie_cde_PWM(pwn_gauche, pwm_droit):
|
||||||
|
commande_PWM = struct.pack('=Bhh',1, pwn_gauche, pwm_droit)
|
||||||
|
msg_envoi_donnees(b'P', 0x0D, commande_PWM)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
||||||
@ -81,7 +88,15 @@ if __name__ == "__main__":
|
|||||||
50. , 0.,
|
50. , 0.,
|
||||||
150. , 200.,
|
150. , 200.,
|
||||||
200. , 200.,)
|
200. , 200.,)
|
||||||
msg_envoi_donnees(b'P', 0x22, traj)
|
# msg_envoi_donnees(b'P', 0x22, traj)
|
||||||
|
|
||||||
|
commande_PWM = struct.pack('=Bhh',1, 000, 000)
|
||||||
|
print(commande_PWM)
|
||||||
|
msg_envoi_donnees(b'P', 0x0D, commande_PWM)
|
||||||
|
|
||||||
|
envoie_cde_PWM(000,0)
|
||||||
|
exit()
|
||||||
|
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
pos = None
|
pos = None
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user