EasyManuals Logo

SunFounder ESP32 User Manual

Default Icon
771 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #608 background imageLoading...
Page #608 background image
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

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the SunFounder ESP32 and is the answer not in the manual?

SunFounder ESP32 Specifications

General IconGeneral
BrandSunFounder
ModelESP32
CategoryController
LanguageEnglish