did some testing, remade model to clean up model tree

This commit is contained in:
laura 2026-06-17 00:07:26 +02:00
parent 3f06a15ebf
commit c0f4e4ea2a
9 changed files with 86 additions and 0 deletions

30
testcode Normal file
View file

@ -0,0 +1,30 @@
from machine import Pin, PWM
from time import sleep
# Set up PWM Pin for servo control
servo_pin = machine.Pin(10)
servo = PWM(servo_pin)
# Set Duty Cycle for Different Angles
max_duty = 7864
min_duty = 1802
half_duty = int(max_duty/2)
#Set PWM frequency
frequency = 50
servo.freq (frequency)
try:
while True:
#Servo at 0 degrees
servo.duty_u16(min_duty)
sleep(2)
#Servo at 180 degrees
servo.duty_u16(max_duty)
sleep(2)
except KeyboardInterrupt:
print("Keyboard interrupt")
# Turn off PWM
servo.deinit()