CARIA.2.2.3

Change the gpio for the servo motor because there is a residual current problem and the method for set_angle
This commit is contained in:
ccunatbrule
2024-09-03 18:33:41 +02:00
parent 2272b03262
commit 97d3cca5cc
4 changed files with 40 additions and 32 deletions

View File

@@ -7,17 +7,18 @@ Ab = AlphaBot()
status = "initialization"
try:
Ab.set_angle(0)
Ab.PWMSERVO.ChangeDutyCycle(Ab.set_angle(0))
print("Positionné à 0°")
time.sleep(2)
Ab.set_angle(90)
time.sleep(1)
Ab.PWMSERVO.ChangeDutyCycle(Ab.set_angle(90))
print("Positionné à 90°")
time.sleep(2)
Ab.set_angle(180)
print("Positionné à 18")
time.sleep(2)
Ab.set_angle(0)
time.sleep(1)
Ab.PWMSERVO.ChangeDutyCycle(Ab.set_angle(120))
print("Positionné à 12")
time.sleep(1)
Ab.PWMSERVO.ChangeDutyCycle(Ab.set_angle(0))
print("Positionné à 0°")
time.sleep(1)
status = "movement successful"
except KeyboardInterrupt:
print("Interruption par l'utilisateur.")