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,38 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import RPi.GPIO as GPIO
import time
import sys
sys.path.append('/home/christian/WebControl/modules/')
from AlphaBot import AlphaBot
Ab = AlphaBot()
speed = 100
DR = 16
DL = 19
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(DR,GPIO.IN,GPIO.PUD_UP)
GPIO.setup(DL,GPIO.IN,GPIO.PUD_UP)
try:
while True:
DR_status = GPIO.input(DR)
DL_status = GPIO.input(DL)
if((DL_status == 1) and (DR_status == 1)):
Ab.forward(speed)
elif((DL_status == 1) and (DR_status == 0)):
Ab.left(speed)
elif((DL_status == 0) and (DR_status == 1)):
Ab.right(speed)
else:
Ab.backward(speed)
time.sleep(0.2)
Ab.left(speed)
time.sleep(0.2)
Ab.stop()
except KeyboardInterrupt:
GPIO.cleanup();

View File

@@ -0,0 +1,35 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import RPi.GPIO as GPIO
import time
import sys
sys.path.append('/home/christian/WebControl/modules/')
from AlphaBot import AlphaBot
Ab = AlphaBot()
DR = 16
DL = 19
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(DR,GPIO.IN,GPIO.PUD_UP)
GPIO.setup(DL,GPIO.IN,GPIO.PUD_UP)
Ab.stop()
speed=100
try:
while True:
DR_status = GPIO.input(DR)
DL_status = GPIO.input(DL)
if((DL_status == 0) and (DR_status == 0)):
Ab.forward(speed)
elif((DL_status == 1) and (DR_status == 0)):
Ab.right(speed)
elif((DL_status == 0) and (DR_status == 1)):
Ab.left(speed)
else:
Ab.stop()
except KeyboardInterrupt:
GPIO.cleanup();