Lesson 8 – 7 Segment Display

Introduction

I’m CERTAIN you’ve seen 7-segment displays. Their are used in digital clocks and dashboards for various consumer appliances such as laundry machines and air fryers. Today, we are going to work with a SINGLE 7-segment display.
The display is split into 7 segments (a, b, c, d, e, f, g) which is each comprised of an LED. This gives the name 7-segment display.

The Circuit

Circuit assembled on a breadboard
Schematic

Program Description

The Arduino program controls a seven-segment display to show numbers from 0 to 9 sequentially, with each number displayed for one second.
Using defined functions for each number allows the program to manage the individual segments effectively, making it straightforward to display these numerals continuously. Also, this allows the code to be compartmentalized, which I prefer.
See the flowchart below for more information

Code flowchart