#!/usr/bin/env python3 import serial import functions ser = serial.Serial("/dev/ttyUSB0") ser.setBaudrate(57600) functions.reset_pic() functions.init_ax(ser) # Attente du start answer = functions.get_ans(ser) while answer != "$STRT;": answer = functions.get_ans(ser) # Demande de l'équipe team = functions.ask_team(ser) # Déplacement functions.move_pos(ser, 0.1, 0) answer = functions.get_ans(ser) while answer != "$DONE;": if (functions.Sicks == 0): functions.move_pos(ser, 0.1, 0) answer = functions.get_ans(ser) # Rotation if team == 'g': functions.rotate(ser, 0.785) else:
#!/usr/bin/env python3 import serial import functions import Functions_battle from time import sleep ser = serial.Serial("/dev/ttyAMA0",57600) functions.reset_pic() functions.init_ax(ser) # Attente du start print "waiting for start" answer = functions.get_ans(ser) while answer != "$STRT;": answer = functions.get_ans(ser) print answer # demande de l'equipe team = 0 while team==0 : team = functions.ask_team(ser) configuration = 4 while configuration==0: configuration = functions.ask_conf(ser) ReDo = 0; ############################### ## DEBUT DE ROUTINE DE MATCH ##