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 #648 background imageLoading...
Page #648 background image
SunFounder ESP32 Starter Kit
Now stick a black electrical tape on the desktop, put the Line Track module at a height of 2cm from the desktop.
With the sensor facing down, observe the signal LED on the module to make sure it lights up on the white table and
goes off on the black tape.
If not, you need to adjust the potentiometer on the module, so that it can do the above effect.
4.22.3 Programming
Here we need to create 3 sprites, Heart, Square Box and Arrow1.
Heart: stops in the middle of the stage, if touched by Arrow1 sprite, the game is over.
Square Box: There are two types of costumes, black and white, and will switch costumes according to the value
of Line Tracking module.
Arrow: flies towards the middle of the stage from any position in black/white; if its color matches the color of
the Square Box sprite, it is blocked and re-flies towards the middle of the stage from a random position; if its
color does not match the color of the Square Box sprite, it passes through the Heart sprite and the game is over.
1. Add Square Box sprite
Since the Arrow1 and Square Box sprite both have white costumes, in order for them to be displayed on the stage, now
fill the background with a color that can be any color except black, white, and red.
Click on Backdrop1 to go to its Backdrops page.
Select the color you want to fill.
Use the Rectangle tool to draw a rectangle the same size as the drawing board.
Delete the default sprite, use the Choose a Sprite button to add the Square Box sprite, and set its x and y to (0, 0).
642 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