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 it’s 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.
It’s definitely convenient to buy a whole kit, here’s 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