SunFounder ESP32 Starter Kit
4.19.3 Programming
There are 3 sprites on the stage.
1. Paddle sprite
The effect to be achieved by the Paddle is that the initial position is in the middle of the bottom of the stage, and it is
controlled by a potentiometer to move it to the left or to the right.
• Delete the default sprite, use the Choose a Sprite button to add the Paddle sprite, and set its x and y to (0, -140).
• Go to the Costumes page, remove the Outline and change its color to dark gray.
• Now script the Paddle sprite to set its initial position to (0, -140) when the green flag is clicked, and read the
value of pin35 (potentiometer) into the variable a0. Since the Paddle sprite moves from left to right on the stage
at x-coordinates -195~195, you need to use the [map] block to map the variable a0 range 0~4095 to -195~195.
602 Chapter 4. Play with Scratch