Created
July 8, 2025 18:17
-
-
Save pfcoperez/864d1b382a8362fa9080e7f1d687dae0 to your computer and use it in GitHub Desktop.
Micropythong example to control g9 microservos
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from machine import Pin, PWM | |
pwm = PWM(Pin(4)) | |
pwm.freq(50) | |
def demo(): | |
st = False | |
for x in range(1,10): | |
if st: | |
pwm.duty_u16(int(65536*0.5/20)) | |
else: | |
pwm.duty_u16(int(65536*2/20)) | |
st = not st | |
time.sleep(2) | |
print(x) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment