Sunday 24 June 2018

PROGRAMING 8 BY 8 LED MATRIX WITH ARDUINO



INTRODUCTION

                                  My name is Arsal Hameed. I am the owner and founder of Arsal Arduino.
  In this post I gonna show u that how you can  interface 8 by 8 Dot Matrix with Arduino.  This
  gonna be very interesting. An 8 by 8 Led Matrix has 64 leds in the order to for matrix that is why
  it is called 8 by 8 Led Matrix.




  The Led Matrix Module has an IC which is
  MAX7219. It has fived pins namely VCC,
  GND, DIN, CS, CLK. This module will 
  be interface with Arduino for displaying
  characters. For this we have to add library
  of the project to the Arduino libraries 
  folder which is in your Arduino folder.







The link from where  you can install library:
    After downloading the zip file, extract the content to  Arduino libraries folder. This library is 
    specially design for the 8 by 8 Matrix. Open the Arduino software. Now you will be able to 
    use feature of Matrix interface.

Components Required

Hardware:

                       Arduino uno, 8 by 8 Dot Matrix, M/F jumper wires, A/B cable

Software:

                      Arduino IDE


Connections

   Matrix  VCC - Arduino 5V

   Matrix GND - Arduino GND

   Matrix DIN  - Arduino D12

   Matrix CS    - Arduino D10

   Matrix CLK - Arduino D11

Code

  
/*
 * This video shows you how to use MAX7219 module with 8x8 LED matrix to display text or any characters on the LED.
* watch YouTube video: https://youtu.be/AAiDwBKs9uE
 * 
 *Written by Ahmad S. for Robojax.com
 *on Feb 26, 2017 in Ajax, Ontario, Canada
 * Permission granted to share this code given that this
 * note is kept with the code.
 * Disclaimer: this code is "AS IS" and for educational purpose only.

 */

//We always have to include the library
// Based on a project posted https://github.com/wayoda/LedControl
#include "LedControl.h"

/*
 Now we need a LedControl to work with.
 // Customized for RoboJax.com on Feb 26, 2017 in Ajax, Ontario, Canada.
 ***** These pin numbers will probably not work with your hardware *****
 pin 12 is connected to the DataIn 
 pin 11 is connected to the CLK 
 pin 10 is connected to CS
 We have only a single MAX72XX.
 */
LedControl lc=LedControl(12,11,10,1);

/* we always wait a bit between updates of the display */
unsigned long delaytime=600;

void setup() {
  /*
   The MAX72XX is in power-saving mode on startup,
   we have to do a wakeup call
   */
  lc.shutdown(0,false);
  /* Set the brightness to a medium values */
  lc.setIntensity(0,8);
  /* and clear the display */
  lc.clearDisplay(0);
}

/*
 This method will display the characters for the
 word "Arduino" one after the other on the matrix. 
 (you need at least 5x7 leds to see the whole chars)
 */
void writeArduinoOnMatrix() {
  /* here is the data for the characters */

 byte A[8]={B00111000,B01000100,B10000010,B11111110,B10000010,B10000010,B10000010,B10000010};     
  byte B[8]={B11111100,B10000100,B10000100,B11111000,B10001000,B10000100,B10000100,B11111100};
  byte C[8] = { B00111100,B01000010,B10000000,B10000000,B10000000,B10000000,B01000010,B00111100};
  byte D[8] = { B11110000,B10001000,B10000100,B10000100,B10000100,B10000100,B10001000,B11110000};
  byte E[8] = { B11111100,B10000100,B10000000,B11110000,B11110000,B10000000,B10000100,B11111100};
  byte F[8] =  { B11111100,B10000100,B10000000,B11110000,B11110000,B10000000,B10000000,B10000000};
  byte G[8] = { B11111100,B10000010,B10000000,B10000000,B10011110,B10000010,B10000010,B01111100};
  byte H[8] = { B01000010,B01000010,B01000010,B01111110,B01000010,B01000010,B01000010,B01000010};
  byte I[8] =  { B00011000,B00011000,B00011000,B00011000,B00011000,B00011000,B00011000,B00011000};
  byte J[8]={B00011110,B00000100,B00000100,B00000100,B10000100,B10000100,B01000100,B00111000};
  byte K[8] =  { B10001000,B10010000,B10100000,B11000000,B10100000,B10010000,B10001000,B10000100};
  byte L[8] =  { B10000000,B10000000,B10000000,B10000000,B10000000,B10000000,B10000000,B11111100};
  byte M[8] =  { B10000001,B10000001,B11000011,B10100011,B10100101,B10010101,B10001001,B10001001};
  byte N[8] = { B01000010,B01100010,B01100010,B01010010,B01001010,B01000110,B01000110,B01000010};
  byte O[8]={B00011000,B00100100,B01000010,B01000010,B01000010,B01000010,B00100100,B00011000};  
  byte P[8] = { B01111000,B01000100,B01000100,B01000100,B01111000,B01000000,B01000000,B01000000};
  byte Q[8] = { B00111000,B01000100,B01000100,B01000100,B01000100,B01010100,B01001000,B00110100};
  byte R[8]={B11111100,B10000100,B10000100,B11111000,B10100000,B10010000,B10001000,B10000100}; 
  byte S[8] = { B00011100,B00100010,B00100000,B00010000,B00001100,B00000010,B00100010,B00011100};
  byte T[8] = { B00111110,B00001000,B00001000,B00001000,B00001000,B00001000,B00001000,B00001000};
  byte U[8] = { B01000010,B01000010,B01000010,B01000010,B01000010,B01000010,B00100100,B00011000};
  byte V[8] = { B10000001,B10000001,B11000011,B01000010,B01100110,B00100100,B00011000,B00011000};
  byte W[8] = { B10000001,B10000001,B10000001,B11010011,B01010010,B01010010,B01111110,B00111000};
  byte X[8]={ B10000001,B01000010,B00100100,B00011000,B00011000,B00100100,B01000010,B10000001};
  byte Y[8]= { B10000001,B01000010,B00100100,B00011000,B00011000,B00011000,B00011000,B00011000};
  byte Z[8]= { B11111111,B00000011,B00000100,B00001000,B00010000,B00100000,B11000000,B11111111};
  byte love[8]={ B00000000,B01100110,B10011001,B10011001,B10000001,B01000010,B00100100,B00011000};  

  //Arsal Arduino
  /* Letter A   */
  for (int i=0; i<8; i++){
  lc.setRow(0,i,A[i]);
  }   
  delay(delaytime);
  for(int i=0; i<8; i++){
      lc.setRow(0,i,0);// this is for blank
  }  
  
  /* Letter R   */
  for (int i=0; i<8; i++){
  lc.setRow(0,i,R[i]);
  }   
  delay(delaytime);
  for(int i=0; i<8; i++){
      lc.setRow(0,i,0);// this is for blank
  }  
  
  
  /* Letter S   */
  for (int i=0; i<8; i++){
  lc.setRow(0,i,S[i]);
  }   
  delay(delaytime);
  for(int i=0; i<8; i++){
      lc.setRow(0,i,0);// this is for blank
  }  
  
  
  /* Letter A   */
  for (int i=0; i<8; i++){
  lc.setRow(0,i,A[i]);
  }   
  delay(delaytime);
  for(int i=0; i<8; i++){
      lc.setRow(0,i,0);// this is for blank
  }  
  
  
  /* Letter L   */
  for (int i=0; i<8; i++){
  lc.setRow(0,i,L[i]);
  }   
  delay(delaytime);
  for(int i=0; i<8; i++){
      lc.setRow(0,i,0);// this is for blank
  }  
  
  
  /* Letter Blank   */   
  delay(delaytime);
  for(int i=0; i<8; i++){
      lc.setRow(0,i,0);// this is for blank
  }  
  
  delay(delaytime);
  for(int i=0; i<8; i++){
      lc.setRow(0,i,0);// this is for blank
  }  
  
  
  
  /* Letter A   */
  for (int i=0; i<8; i++){
  lc.setRow(0,i,A[i]);
  }   
  delay(delaytime);
  for(int i=0; i<8; i++){
      lc.setRow(0,i,0);// this is for blank
  }  
  
  
  /* Letter R   */
  for (int i=0; i<8; i++){
  lc.setRow(0,i,R[i]);
  }   
  delay(delaytime);
  for(int i=0; i<8; i++){
      lc.setRow(0,i,0);// this is for blank
  }  
  
  
  /* Letter D   */
  for (int i=0; i<8; i++){
  lc.setRow(0,i,D[i]);
  }   
  delay(delaytime);
  for(int i=0; i<8; i++){
      lc.setRow(0,i,0);// this is for blank
  }  
  
  
  /* Letter U   */
  for (int i=0; i<8; i++){
  lc.setRow(0,i,U[i]);
  }   
  delay(delaytime);
  for(int i=0; i<8; i++){
      lc.setRow(0,i,0);// this is for blank
  }  
  
  
  /* Letter I   */
  for (int i=0; i<8; i++){
  lc.setRow(0,i,I[i]);
  }   
  delay(delaytime);
  for(int i=0; i<8; i++){
      lc.setRow(0,i,0);// this is for blank
  }  
  
  
  /* Letter N   */
  for (int i=0; i<8; i++){
  lc.setRow(0,i,N[i]);
  }   
  delay(delaytime);
  for(int i=0; i<8; i++){
      lc.setRow(0,i,0);// this is for blank
  }  
  
  
  
  /* Letter O   */
  for (int i=0; i<8; i++){
  lc.setRow(0,i,O[i]);
  }   
  delay(delaytime);
  for(int i=0; i<8; i++){
      lc.setRow(0,i,0);// this is for blank
  }  



  /* love */
  for (int i=0; i<8; i++){
  lc.setRow(0,i,love[i]);

  }
   
  delay(delaytime);
  delay(delaytime);
  for(int i=0; i<8; i++){
      lc.setRow(0,i,0);// this is for blank
  }  
/////////////// END of Letter///////

}// writeArduinoOnMatrix()  end


void loop() { 
  writeArduinoOnMatrix();

}

NOTE:

            You can additional signs and characters to the arduino. This is the link of the software:

Video






Social Media

Channel:https://www.youtube.com/channel/UC9rTLEkchWevSLQMszkKHWg

Twitter:https://mobile.twitter.com/arsal_hameed

Facebook Arsal Arduino page:https://web.facebook.com/Arsal-Arduino-121169362083623/

Facebook:https://m.facebook.com/arsal.hameed.564?ref=bookmarks

Instagram:https://www.instagram.com/arsalhameed83/

Google plus Arsal arduino page: https://plus.google.com/collection/4Ss5MF

Website:http://arsalhameed83.blogspot.com/?m=1
_____________________________________
          #SupportArsalArduino

 











































No comments:

Popular Posts