import time
import board
import pwmio
# --- PWM WERTE FÜR BEWEGUNG ---
s = 4915 # Stopp
v = 5570 # Vorwärts
r = 4260 # Rückwärts
# --- KONFIGURATION DER RÄDER ---
pwm_links = pwmio.PWMOut(board.GP0, frequency=50, duty_cycle=0)
pwm_rechts = pwmio.PWMOut(board.GP1, frequency=50, duty_cycle=0)
# --- DEFINITIONEN FÜR BEWEGUNG ---
def stop():
pwm_links.duty_cycle = s
pwm_rechts.duty_cycle = s
time.sleep(1)
def vor():
pwm_links.duty_cycle = v
pwm_rechts.duty_cycle = r
def ruck():
pwm_links.duty_cycle = r
pwm_rechts.duty_cycle = v
def left():
pwm_links.duty_cycle = r
pwm_rechts.duty_cycle = r
time.sleep(1)
def right():
pwm_links.duty_cycle = v
pwm_rechts.duty_cycle = v
time.sleep(3)
# --- HAUPTPROGRAMM ---
stop()
for I in range(4):
vor()
time.sleep(5)
left()