ESP32 Starter Kit
3. Wiring Diagram
4. Test Code
1.Drag the two basic blocks and put a “variable” block between them. Set the variable type to int, name to angle, and
assign 0 as its initial value.
2. Servo gradually rotates from 0° to 180°:
Add a repeat block and set the repeat times to 180(180 angles). Drag a “change variable” and a “servo” block and put
them in the repeat one. Name the variable “angle” and select the mode “++”. Set Servo PIN to IO4 and degree to the
named variable. Don’t forget to delay 15s.
224 Chapter 9. Scratch Tutorial