This commit is contained in:
2025-12-03 14:28:33 +01:00
commit de78b5d9d4
6 changed files with 393 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
from logique_BR import *
def main():
print("Démarrage")
sleep(1)
try:
while True:
if mesure_distance_cm() > 0:
avancer(100)
else:
moteurs_stop(0)
tourner_gauche(90)
if mesure_distance_cm()>0:
avancer(100)
else:
tourner_droite(180)
if mesure_distance_cm()>0:
avancer(100)
else:
tourner_droite(90)
avancer(100)
except KeyboardInterrupt:
moteurs_stop()
print("impossible d'avancer")
# Lancer automatiquement si ce fichier est main.py
if __name__ == "__main__":
main()