Blogroll

Powered by Blogger.

Sunday 31 August 2014

Animated Demonstration of an Amazing Design in an 8*8 LED Matrix (Page 3)

by realfinetime  |  in LED Matrix at  21:06

<<<<  Read Previous Part

Step 14: 
          Turn off all LEDs. For that, shift out 0 to 1st 74595 and 255 to 2nd 74595. This will turn off all LEDs.

Step 15: 
          In 'j' loop, j=1. Shift out 2 (anode_decimal[j]) to 1st 74595 and 85 (cathode_decimal[j]) to 2nd 74595. Q7 Q6 Q5 Q4 Q3 Q2 Q1 Q0 of 1st 74595 becomes 0 0 0 0 0 0 1 0. Similarly, Q7 Q6 Q5 Q4 Q3 Q2 Q1 Q0 of 2nd 74595 becomes 0 1 0 1 0 1 0 1. Now the LED matrix will be as shown below. This step will be done 5 times (i loop) to increase the brightness.


Step 16: 
          Turn off all LEDs. For that, shift out 0 to 1st 74595 and 255 to 2nd 74595. This will turn off all LEDs.

Step 17: 
          In 'j' loop, j=2. Shift out 4 (anode_decimal[j]) to 1st 74595 and 170 (cathode_decimal[j]) to 2nd 74595. Q7 Q6 Q5 Q4 Q3 Q2 Q1 Q0 of 1st 74595 becomes 0 0 0 0 0 1 0 0. Similarly, Q7 Q6 Q5 Q4 Q3 Q2 Q1 Q0 of 2nd 74595 becomes 1 0 1 0 1 0 1 0. Now the LED matrix will be as shown below. This step will be done 5 times (i loop) to increase the brightness.

Step 18: 
          Turn off all LEDs. For that, shift out 0 to 1st 74595 and 255 to 2nd 74595. This will turn off all LEDs.

Step 19: 
          In 'j' loop, j=3. Shift out 8 (anode_decimal[j]) to 1st 74595 and 85 (cathode_decimal[j]) to 2nd 74595. Q7 Q6 Q5 Q4 Q3 Q2 Q1 Q0 of 1st 74595 becomes 0 0 0 0 1 0 0 0. Similarly, Q7 Q6 Q5 Q4 Q3 Q2 Q1 Q0 of 2nd 74595 becomes 0 1 0 1 0 1 0 1. Now the LED matrix will be as shown below. This step will be done 5 times (i loop) to increase the brightness.

Step 20: 
          Turn off all LEDs. For that, shift out 0 to 1st 74595 and 255 to 2nd 74595. This will turn off all LEDs.

'j' loop will be continued for values 4, 5 and 6.

Step 21: 
          In 'j' loop, j=7. Shift out 128 (anode_decimal[j]) to 1st 74595 and 85 (cathode_decimal[j]) to 2nd 74595. Q7 Q6 Q5 Q4 Q3 Q2 Q1 Q0 of 1st 74595 becomes 1 0 0 0 0 0 0 0. Similarly, Q7 Q6 Q5 Q4 Q3 Q2 Q1 Q0 of 2nd 74595 becomes 0 1 0 1 0 1 0 1. Now the LED matrix will be as shown below. This step will be done 5 times (i loop) to increase the brightness.

Step 22: 
          Turn off all LEDs. For that, shift out 0 to 1st 74595 and 255 to 2nd 74595. This will turn off all LEDs.

          Step 13 to Step 22 will be executed quickly and by persistence of vision, matrix will look like as shown below. We have to keep the LED matrix in this state for some time. Here comes the use of 'k' loop. For this, Step 13 to Step 22 will be executed 25 times. This will keep the LED matrix in this state for a few seconds.

Step 23:
          Now, rotate the cathode_decimal[] array one position towards left. Following part of program rotate the array one position towards left.

  // Copy the first element of 'cathode_decimal' array to 'temp'.
  temp=cathode_decimal[0];
  
  /**** Shift all the elements of cathode_decimal array, other than first element, 
  one position towards left ****/
  for(i=1;i<length_of_cathode_decimal_array;i++)
  {
    cathode_decimal[i-1]=cathode_decimal[i];
  }  
  
  /**** Copy the value in 'temp' to last position of 'cathode_decimal' array.
  Then first element in old array becomes last element in new array ****/
  cathode_decimal[length_of_cathode_decimal_array-1]=temp; 

Now 'cathode_decimal' array will become:

          anode_decimal[]={1, 2, 4, 8, 16, 32, 64, 128}
          cathode_decimal[]={85, 170, 85, 170, 85, 170, 85, 170}

          That is, 'cathode_decimal' array had returned to its previous state. Now the processes will be continued again from step 1 in an infinite while loop. This will give the LED matrix illumination as shown below.

Next: Running Arrow Demonstration in 8*8 LED Matrix

4 comments:

  1. Please explain length_of_cathode_decimal_array = sizeof(cathode_decimal)/sizeof(cathode_decimal[0]); I understand the rest of the program but do not understand this .

    ReplyDelete
  2. Hello Jackie and Peter, Just a quick thanks a lot for all of the work you both put in, to get me out in the mess that the Royal Bank created. canada mortgage calculator As for government-backed commercial loans, you could obtain Small Business Administration. mortgage payment calculator

    ReplyDelete
  3. The critical factor that has to be included in almost any Canada Mortgage Calculator may be the calculation of fixed price mortgage interest. mortgage payment calculator SBA 7(a) financing is used for developing owner-occupied business property. mortgage calculator canada

    ReplyDelete
  4. Applying extra payments despite 3 years can still decrease your interest costs. canada mortgage calculator This typically takes effect in the first 3 to five years of a loan. mortgage payment calculator

    ReplyDelete

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.