SunFounder ESP32 Starter Kit
2. Left arrow sprite
When this sprite is clicked, it broadcasts a message - turn, then sets digital pin12 to low and pin14 to high, and sets the
variable flag to 1. If you click the left arrow sprite, you will find that the motor turns counterclockwise, if your turn is
clockwise, then you swap the positions of pin12 and pin14.
There are 2 points to note here.
• [broadcast]: from the Events palette, used to broadcast a message to the other sprites, when the other sprites
receive this message, it will perform a specific event. For example, here is turn, when the star sprite receives
this message, it executes the rotation script.
• variable flag: The direction of rotation of the star sprite is determined by the value of flag. So when you create
the flag variable, you need to make it apply to all sprites.
4.12. 2.9 Rotating Fan 531