🔌 Wiring
Connect a servo motor to output o1.
Add import servo at the top to use servo functions. servo_write_angle(o1, 90) points the servo to 90° — straight up.
import servo setup: o1 = set_function(servo) servo_write_angle(o1, 90) wait(1000) loop: servo_oscillate(o1, 90, 0, 180, 5, 20)
💡 Tip
The last two numbers of servo_oscillate are the step size and the delay. Smaller step or bigger delay = slower, smoother sweep.
🚀 Your turn
Make a waving hand: sweep only between 60° and 120°.