CARIA.2.0

Repo initial CARIA :
MAJ Interface Bootle amélioré
- Optimisation de la structure
- amélioration des fonctionnalités
- debug
. . .
This commit is contained in:
ccunatbrule
2024-05-28 15:47:08 +02:00
parent 6eb3071707
commit 9ae7f229e7
33 changed files with 1553 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
import RPi.GPIO as GPIO
import time
ObstaclePin = 16
def setup():
GPIO.setmode(GPIO.BCM)
GPIO.setup(ObstaclePin, GPIO.IN)
def loop():
while True:
if GPIO.input(ObstaclePin) == GPIO.LOW:
print("Obstacle détecté")
else:
print("Aucun obstacle détecté")
time.sleep(0.5) # Attendre un peu entre les lectures pour éviter les faux positifs
if __name__ == '__main__':
setup()
try:
loop()
except KeyboardInterrupt:
GPIO.cleanup()