SEVEN SEGMENT  display using ARDUINO
      

STEP1-

    

      After three steps we will learn to write the word ON SEVEN SEGMENT (common cathod).

  1. fist we configure the seven segment common cathode display. The common cathode display is have 10 pins . Five upper side and five lower side . The middle pin of upper side pin is the ground pin and similarly the lower side the middle pin is ground pin . the ground pins are common pin . we doesn't need to connect upper pin to  ground separately. fist we connect the ground pin to ground and the we connect 3.3v pin  of the micro controller and variable resistance. the output pin of the variable resistance  is our test pin .  we will connect this pin to the seven segment pin and test . 
as shown in fig.





the upper video help us to configure the seven segment led. we need to configuration because without configure we could not locate the led with the pin. we need to know which pin is connected with which led. we will examine the led with the help of test pin. then we will give the name to pin according to the led . the names are user defined. After configuration we will connect the pin of seven segment to the arduino nano .
the connection of pin are described below.

STEP2-

led pins           arduino pins

a-                                      D2 
b                   -                   D3
c                   -                   D4
d                  -                    D5
e                  -                    D6
f                    -                   D7
g                  -                    D8
h                  -                    D9    
MIDDLE PIN-      GROUND PIN 
         AFTER  SETUP  CIRCUIT WE will burn the arduino nano. the software is given below.
STEP3-


void setup() {
  DDRD=0XFFF;//for portD as output//
  DDRB=0XFF;//for portB as output//
}

void loop() {
  delay(100);
  PORTD=0XFF;// command for write zero on led//
  PORTB=0X00;
  delay(1000);
PORTD=0X18;// command for write 1 on led//
PORTB=0X00;
delay(1000);
PORTD=0X6C;// command for write 2 on led//
PORTB=0X01;
delay(1000);
PORTD=0X3C;// command for write 3 on led//
PORTB=0X01;
delay(1000);
PORTD=0X98;// command for write 4 on led//
PORTB=0X01;
delay(1000);
PORTD=0XB4;// command for write 5 on led//
PORTB=0X01;
delay(1000);
PORTD=0XF4;// command for write 6 on led//
PORTB=0X01;
delay(1000);
PORTD=0X1c;// command for write 7 on led//
PORTB=0X00;
delay(1000);
PORTD=0XFF;// command for write 8 on led//
PORTB=0X01;
delay(1000);
PORTD=0XBC;// command for write 9 on led//
PORTB=0X01;
delay(1000);

}

Comments

Popular posts from this blog