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 #40 background imageLoading...
Page #40 background image
SunFounder ESP32 Starter Kit
int datArray[] = {B00000000, B00000001, B00000011, B00000111, B00001111,
˓B00011111, B00111111, B01111111, B11111111};
2. loop() function.
void loop()
{
for(int num = 0; num <10; num++)
{
digitalWrite(STcp,LOW); //Set ST_CP and hold low for as long as
˓you are transmitting
shiftOut(DS,SHcp,MSBFIRST,datArray[num]);
digitalWrite(STcp,HIGH); //pull the ST_CPST_CP to save the data
delay(1000);
}
}
Iterates through the datArray[], sequentially sending the binary values to the shift register.
The digitalWrite(STcp, LOW) and digitalWrite(STcp, HIGH) commands latch the data
into the storage register.
shiftOut() function sends the binary values from datArray[] to the shift register using the
data pin (DS) and shift register clock pin (SHcp). MSBFIRST means to move from high bits.
Then create a 1-second pause between each LED pattern update.
1.9 2.5 7 Segment Display
Welcome to this fascinating project! In this project, we will explore the enchanting world of displaying numbers from
0 to 9 on a seven-segment display.
Imagine triggering this project and witnessing a small, compact display glowing brightly with each number from 0 to
9. It’s like having a miniature screen that showcases the digits in a captivating way. By controlling the signal pins, you
can effortlessly change the displayed number and create various engaging effects.
Through simple circuit connections and programming, you will learn how to interact with the seven-segment display
and bring your desired numbers to life. Whether its a counter, a clock, or any other intriguing application, the seven-
segment display will be your reliable companion, adding a touch of brilliance to your projects.
Required Components
In this project, we need the following components.
Its definitely convenient to buy a whole kit, heres the link:
Name ITEMS IN THIS KIT LINK
ESP32 Starter Kit 320+
You can also buy them separately from the links below.
34 Chapter 1. For Arduino User

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