Difference between revisions of "Arduino/C2/Seven-Segment-Display/English-timed"

From Script | Spoken-Tutorial
Jump to: navigation, search
 
Line 24: Line 24:
 
'''Arduino UNO Board''',
 
'''Arduino UNO Board''',
  
'''Ubuntu Linux operating system '''14.04'''''' and
+
'''Ubuntu Linux operating system 14.04''' and
  
 
'''Arduino IDE'''.
 
'''Arduino IDE'''.

Latest revision as of 16:00, 23 October 2018

Time Narration
00:01 Welcome to the Spoken Tutorial on Seven Segment Display.
00:06 In this tutorial, we will learn to:

connect a Seven Segment Display to Arduino board and

write a program to display digits from 0 to 4 on the Seven Segment Display.

00:24 To follow this tutorial, you should have basic knowledge of electronics and C or C++ programming language.
00:37 To record this tutorial, I am using:

Arduino UNO Board,

Ubuntu Linux operating system 14.04 and

Arduino IDE.

00:52 We will also require some external devices such as:

Seven-Segment Display, 220 ohm Resistor, Breadboard and Jumper Wires.

01:08 The seven-segment display has seven LEDs arranged in the shape of the digit eight.
01:17 There are two types of displays:

common anode and common cathode seven segment display.

01:27 In the common cathode seven-segment display, pins a, b, c, d, e, f, g and dot must be connected to +5V.
01:43 The two COM pins must be connected to ground (GND).
01:49 The common anode seven-segment display is the exact opposite.
01:55 Here, pins a, b, c, d, e, f, g and dot must be connected to GND and the two COM pins must be connected to +5V.
02:12 Now, let us see the connection circuit details.
02:17 In this experiment, we will be using the common cathode seven-segment display.
02:24 Pins a, b, c, d, e, f and g of the seven-segment display are connected to pins 2, 3, 4, 5, 6, 8 and 9 of Arduino respectively.
02:40 Note that we didn't connect to pin 7.
02:45 The two common (COM) pins are connected to the ground through the resistors.

This is shown here in the black color wire.

02:56 The resistor value should be greater than 220 ohms.

Dot is left unconnected because it is not used in this experiment.

03:08 This is the live setup of the connection as shown in the circuit diagram.
03:15 Now we will write a program in the Arduino IDE. So, let’s switch to the Arduino IDE.
03:24 First we will write a program to blink the LEDs in the seven segment display.
03:31 Type the code shown here.
03:34 We have assigned the segment names to the Arduino pins.
03:39 These help us to remember easily which Arduino ports are connected to the display’s segments.
03:47 This code is available in the code file link of this tutorial for your convenience. You can download and use it.
03:57 In the void setup function, we will use the function pinMode to configure the pin to output mode.
04:07 Now we will write the code for void loop.

Void loop function will blink the LED of the seven segment display.

04:18 The code is same as the ones in the earlier tutorials.
04:23 We will now compile and upload the program.
04:27 Now we can see that all the LEDs in the seven segment are glowing.
04:35 Next, we will modify the program to display some digits.
04:41 Say, we want to display the digit zero.
04:46 The LEDs of segment 'g' should be low and all other LED segments should be high.
04:54 To display '1', b and c segments should be high and the other LEDS should be low.

Likewise, we can write the code for all other digits also.

05:10 Let us switch back to the Arduino IDE.
05:14 Change the code in the void loop function, as shown here.

I have written the code to display the digits 0,1,2,3 and 4.

05:31 Let us now compile and upload the program.
05:35 You can see that the digits 0 to 4 are displayed, with a delay of 1 second between them.
05:45 This brings us to the end of this tutorial. Let us summarize.
05:52 In this tutorial, we learnt to

connect a Seven-segment Display to Arduino board and write a program to display digits from 0 to 4 on a seven-segment display.

06:07 Try doing the following assignment.

Change the same program to display the digits 5,6,7,8 and 9.

Compile and upload the program and observe the digits displayed in the seven segment display.

06:27 The video at the following link summarizes the Spoken Tutorial project.

Please download and watch it.

06:35 The Spoken Tutorial Project team:

conducts workshops and gives certificates. For more details, please write to us.

06:44 Please post your timed queries in this forum.
06:48 Spoken Tutorial project is funded by NMEICT, MHRD, Government of India. More information on this mission is available at this link.
07:00 This tutorial has been contributed by Spoken Tutorial Project, IIT Bombay. Thanks for watching.

Contributors and Content Editors

Pratik kamble, Sandhya.np14