completed V0.2 version
This commit is contained in:
parent
c0f4e4ea2a
commit
3e63ec43fa
16 changed files with 25938 additions and 26892 deletions
23
main.py
Normal file
23
main.py
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
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)
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue