Blogroll

Powered by Blogger.

Saturday, 13 September 2014

Demonstration of the Use of Persistence of Vision in 16*8 LED Matrix (Part 9 of 13)

by realfinetime  |  in LED Matrix at  11:57

<<<<  Read previous part (Part 8)

          We had already seen the frames needed to generate "HE" display. In the last blog, we created the fourth frame for "HE" display. In this blog, we will create the fifth frame. Complete the circuit given in this page. Upload the following program to your arduino board. This program will create the fifth frame for "HE" display.


int latchPin = 11;  //Pin connected to ST_CP of 1st 74595
int clockPin = 12;  //Pin connected to SH_CP of 1st 74595
int dataPin = 13;   //Pin connected to DS of 1st 74595

int latchPin2 = 8;  //Pin connected to ST_CP of 2nd 74595
int clockPin2 = 9;  //Pin connected to SH_CP of 2nd 74595
int dataPin2 = 10;  //Pin connected to DS of 2nd 74595

void setup() {
  //set pins to output so you can control the shift register
  pinMode(latchPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  pinMode(dataPin, OUTPUT);
  
  pinMode(latchPin2, OUTPUT);
  pinMode(clockPin2, OUTPUT);
  pinMode(dataPin2, OUTPUT);
}

void loop() {
  
    // take the latchPin low so the LEDs don't change while you're sending in bits:     
    digitalWrite(latchPin, LOW);
    //Send 1 1 1 1 1 1 1 0 (254) to Q7 Q6 Q5 Q4 Q3 Q2 Q1 Q0 of 2nd 74595
    shiftOut(dataPin, clockPin, MSBFIRST, 254);
    //Send 1 1 1 1 1 1 1 1 (255) to Q7 Q6 Q5 Q4 Q3 Q2 Q1 Q0 of 1st 74595
    shiftOut(dataPin, clockPin, MSBFIRST, 255);
    // shift out the bits:    
    digitalWrite(latchPin, HIGH);
          
    // take the latchPin low so the LEDs don't change while you're sending in bits:    
    digitalWrite(latchPin2, LOW);
    //Send 1 1 1 0 1 1 1 1 (239) to Q7 Q6 Q5 Q4 Q3 Q2 Q1 Q0 of 3rd 74595
    shiftOut(dataPin2, clockPin2, MSBFIRST, 239);
    // shift out the bits:  
    digitalWrite(latchPin2, HIGH); 
    

    /********* Turn off all the LEDs *********/
    
    // take the latchPin low so the LEDs don't change while you're sending in bits:    
    digitalWrite(latchPin2, LOW);
    //Send 1 1 1 1 1 1 1 1 (255) to Q7 Q6 Q5 Q4 Q3 Q2 Q1 Q0 of 3rd 74595
    shiftOut(dataPin2, clockPin2, MSBFIRST, 255);
    // shift out the bits:  
    digitalWrite(latchPin2, HIGH);    
}

Output of the above program can be seen in 16*8 LED display. Output is given below.


          Arduino will shift out number 254 to the first 74595. Then, 254 will be stored in first 74595. After that, arduino will shift out number 255 to the first 74595. Then, 254 will be shifted to the second 74595 from first 74595 and 255 will be stored in first 74595. After that, arduino will shift out 239 to the third 74595. This can be pictorially represented as shown below. 255 stored in first 74595 will appear across the anode terminals of first 8*8 LED matrix. 254 stored in second 74595 will appear across the anode terminals of second 8*8 LED matrix. 239 stored in third 74595 will appear across the cathode terminals of both 8*8 LED matrices which will give the expected output.

          After that, turn off all LEDs by shifting out 255 to the third 74595. 255 will send HIGH to the cathode terminals of LED matrices which will turn off all LEDs.


Continued in next page (part 10)

0 comments:

IMPORTANT NOTICE

All the circuits, published in this blog is only after testing and getting proper results in my private lab. When you try these circuits, you should check the supply voltage, polarity of components, presence of childrens nearby and shorts in the circuits. This website will not be responsible for any harm happened to you or your components caused by your carelessness.

For More Electronic Tips

Blog Archive

Proudly Powered by Blogger.