s1=pyb.Servo(1) # create a servo object on position X1
while(True):
s1.angle(0)
time.sleep(1)
s1.angle(90)
time.sleep(1)
s1.angle(0)
time.sleep(1)
s1.angle(-90)
time.sleep(1)
Expected Result
Copy the sample code in the uPyCraft IDE, save it and click the DownloadAndRun
button, you will see the servo constantly spinning.
FAQ
For any questions, advice or cool ideas to share, please visit the DFRobot Forum.
https://www.dfrobot.com/wiki/index.php/Gravity:_I/O_Expansion_Shield_for_Pyboard_SKU:DFR057710‐23‐18