removed micropython code

This commit is contained in:
laura 2026-06-19 10:32:40 +00:00
parent 047bd572aa
commit 4b6b1c9f73
2 changed files with 0 additions and 53 deletions

23
main.py
View file

@ -1,23 +0,0 @@
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)
for i in range(20000):
servo.duty_u16(max_duty)
sleep(1)
servo.duty_u16(min_duty)
sleep(1)

View file

@ -1,30 +0,0 @@
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()