๐ Wiring
Connect a servo motor to output o1.
Add from servo import * at the top to use servo functions. servo_write_angle(o1, 90) points the servo to 90ยฐ โ straight up.
from tinkerpy_mega import * from servo import * def setup(): set_function(o1, SERVO) servo_write_angle(o1, 90) wait(1000) def 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ยฐ.