Arduino Push Button & 7-Segment Display Guide
Arduino Push Button & 7-Segment Display Guide
ARDUINO
Figure 2
1/6
When the button is lifted, it is ultimately not connected to anything. The result read by the Arduino is therefore low.
interpretable. There is a way to force the Arduino to read something, simply by adding
of a resistance...
1. Explain the operating principle of the two diagrams presented above and indicate the role of
the resistance R(10KΩ)
…………………………………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………………………………………
To read the state of the push button, you need to use the function: digitalRead(pin).
Manipulation :
Write a program that allows you to turn on the LED associated with pin 3 when the button is pressed.
Button associated with pin 2, the LED should turn off and when the button is released, the LED should turn on.
In other words, as long as the button is off, the LED is on.
Figure 3
2/6
➔Compile the program.
➔ Create the diagram in PROTEUS and transfer the .hex file to the microcontroller.
➔Then simulate the operation.
➔ Create the wiring diagram.
➔Transfer your compiled program to the microcontroller, then validate the operation.
PART B:
Presentation
A 7-segment display has 7 LEDs embedded in a casing. Therefore, there are 8 sections.
counting the decimal point (DP) of the display. These are the little lights that form the number 8 and that
are red or green in color most of the time, but can also be blue, white, etc.
3/6
Power the Arduino board (via USB cable / PC). Check the proper functioning of the display: the
segments connected to the mass via their resistances should light up when you power the circuit.
4. Manipulation 1: Display numbers and letters
a) Take the previous diagram again, but by connecting each pin (segment) of the display to
an output from the Arduino board, where each LED of the display will be controlled separately
one another.
4/6
Assembly instructions
. Connect to pin 2 (configured as output) the
pin of the segmented digit via a resistor in
series
. Connect to pin 3 (configured as output) the
connect the digit segment via a resistor in
series
. Connect to pin 4 (configured as output) the
connect the digit segment via a resistor in
series
. Connect to pin 5 (configured as output) the
pin of the segment of the digit through a resistor in
series
. Connect pin 6 (configured as output) to the segment g of the digit via a
series resistance
. Connect pin 7 (configured as output) to the segment pin of the digit via a
series resistance
. Connect pin 8 (set as output) to the segment pin of the digit via a
series resistance
. Connect pin 9 (configured as output) to the segment b of the digit via a
series resistance
5/6
Annex
6/6