Data Sheet
LESSON 4
7 SEGMENT DISPLAY
HARDWARE CONNECTION
SCHEMATIC DIAGRAM
LESSON 4
| 26
INTRODUCTION
7 segment display is an arrangement of LEDs that able to display decimal numbers.
#include "pitches.h"
int melody[] = {
NOTE_C4, NOTE_G3, NOTE_G3, NOTE_A3, NOTE_G3, 0, NOTE_B3,
NOTE_C4
};
int noteDurations[] = {
4, 8, 8, 4, 4, 4, 4, 4
};
void setup()
{
for (int thisNote = 0; thisNote < 8; thisNote++)
{
int noteDuration = 1000 / noteDurations[thisNote];
tone(8, melody[thisNote], noteDuration);
int pauseBetweenNotes = noteDuration * 1.30;
delay(pauseBetweenNotes);
noTone(8);
}
void loop()
{
7 Segment Led
8
3
5
10
9
1
2
4
6
7
G2
G1
DP
G
F
E
D
C
B
A
RX 0
TX 1
2
~3
4
~5
~6
A5
A4
A3
A2
A1
A0
7
8
~9
~10
~11
12
13
5V VIN3V3
MAKER UNO
GND
220Ω
220Ω
220Ω
220Ω
220Ω
220Ω
220Ω
220Ω