• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here: Home » Arduino 8×8 LED Dot Matrix Display With MAX7219 : Code

By Abhishek Ghosh October 18, 2017 9:20 am Updated on November 9, 2017

Arduino 8×8 LED Dot Matrix Display With MAX7219 : Code

Advertisement

Previously we shared many guides with TM1637 7 segment LED display. TM1637 was shown as it is mainly software based control, least knowledge on electronics needed. We actually discussed about MAX7219 in various articles like on increasing the number of pins of Arduino, This guide is on Arduino 8×8 LED Dot Matrix Display with MAX7219 code for testing for the beginners with one 8×8 LED Dot Matrix Board to get started. We made it obvious on LED bar display article that each LED on these boards is nothing but just another LED. In case of 8×8 LED Dot Matrix Display, these LED has common cathode. The same common cathode is used for single 7 segment LED display module. In a single 7 segment LED display, there is 8 and a dot. As we said before, one of the thing MAX7219 IC does is multiplexing – we can buy a separate MAX7219 IC and control LED, 7 segment LED etc. China 8×8 LED Dot Matrix Displays cost less than one MAX7219 IC! So, instead of buying a single MAX7219 IC plus 8×8 LED Dot Matrix, it is practical to buy them as module. Peoples usually add multiple 8×8 LED Dot Matrix Displays in real life to display text, graphics as sign board on public place. If we know to run 8×8 LED Dot Matrix Display with MAX7219, we can create Christmas of Diwali light with plain LED and MAX7219 IC – easy China like thought! So much written here for that reason :

Vim
1
https://playground.arduino.cc/Main/MAX72XXHardware

 

Arduino 8×8 LED Dot Matrix Display With MAX7219

 

These modules have 5 pins. For our and most guides, libraries the connection will be :

VCC connects to 5v of Arduino (always, constant)
GND connects to GND of Arduino (always, constant)
DIN connects to pin 12 of Arduino (variable)
CLK connects to pin 11 of Arduino (variable)
CS connects to pin 10 of Arduino (variable)

Advertisement

---

Please note that : the pins on the modules are serially VCC, GND, DIN, CS, CLK but usually libraries, and guides do not maintain the order of serial with respect to pin number. It is normal to connect in wrong pin and cry. For some reason, pin 12, 11, 10 works great for most of these displays.

Arduino 8x8 LED Dot Matrix Display With MAX7219

Install these libraries :

Vim
1
2
https://github.com/wayoda/LedControl
https://github.com/AbhishekGhosh/Arduino_LED_matrix_sketch

This is example code for 0 to 9 count display :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include "LedControlMS.h"
 
/*
Configuring the LEDMatrix:
VCC connects to 5v of Arduino
GND connects to GND of Arduino
DIN connects to pin 12 of Arduino
CLK connects to pin 11 of Arduino
CS connects to pin 10 of Arduino
There is only one MAX7219 display module.
*/
 
#define NBR_MTX 2
LedControl lc=LedControl(12,11,10, NBR_MTX);
 
String sentence= "1234567890 ";
int letterCounter=0;
/* wait time between updates of the display */
unsigned long delaytime=300;
 
void setup() { // initalizes and sets up the initial values. Declaring function setup.
  /* The display module is in power-saving mode on startup.
  Do a wakeup call */
  Serial.begin(9600); // setting data rate as 9600 bits per second for serial data communication to computer
  Serial.println("Setup"); //prints data to serial port as human-readable text
  letterCounter=0;
  for (int i=0; i< NBR_MTX; i++){
    lc.shutdown(i,false); //keep the screen on
    lc.setIntensity(i,8); // set brightness to medium values
    lc.clearDisplay(i); //clear the display after each letter
  }
}
 
void loop() { //declaring function loop
  char ch= sentence[letterCounter]; //define character ch
  letterCounter++;
  if (letterCounter>14) letterCounter=0; //sets up loop
  lc.displayChar(0, lc.getCharArrayPosition(ch)); //display each character on the screen
  delay(1000);
  lc.clearAll();
  delay(2);
}

Here is video :

This code is good for making Christmas light, Diwali light made with up to 64 LEDs and MAX7219 IC :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "LedControl.h"
LedControl lc=LedControl(12,11,10,1);
  /* Set the time */
unsigned long delaytime=20;
void setup() {
  lc.shutdown(0,false);
  /* Set the brightness */
  lc.setIntensity(0,2);
  lc.clearDisplay(0);
}
void writeArduinoOnMatrix() {
}
void single() {
  for(int row=0;row<8;row++) {
    for(int col=0;col<8;col++) {
      delay(delaytime);
      lc.setLed(0,row,col,true);
      delay(delaytime);
      for(int i=0;i<col;i++) {
        lc.setLed(0,row,col,false);
        delay(delaytime);
        lc.setLed(0,row,col,true);
        delay(delaytime);
      }
    }
  }
}
void loop() {
  writeArduinoOnMatrix();
  single();
  lc.clearDisplay(0);
}

This code will animate :-| and :-( :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#include "LedControl.h"
#include "binary.h"
 
/*
DIN connects to pin 12
CLK connects to pin 11
CS connects to pin 10
*/
LedControl lc=LedControl(12,11,10,1);
 
// delay time between faces
unsigned long delaytime=1000;
 
// happy face
byte hf[8]= {B00111100,B01000010,B10100101,B10000001,B10100101,B10011001,B01000010,B00111100};
// neutral face
byte nf[8]={B00111100, B01000010,B10100101,B10000001,B10111101,B10000001,B01000010,B00111100};
// sad face
byte sf[8]= {B00111100,B01000010,B10100101,B10000001,B10011001,B10100101,B01000010,B00111100};
 
void setup() {
  lc.shutdown(0,false);
  // Set brightness to a medium value
  lc.setIntensity(0,8);
  // Clear the display
  lc.clearDisplay(0);  
}
 
void drawFaces(){
  // Display sad face
  lc.setRow(0,0,sf[0]);
  lc.setRow(0,1,sf[1]);
  lc.setRow(0,2,sf[2]);
  lc.setRow(0,3,sf[3]);
  lc.setRow(0,4,sf[4]);
  lc.setRow(0,5,sf[5]);
  lc.setRow(0,6,sf[6]);
  lc.setRow(0,7,sf[7]);
  delay(delaytime);
  
  // Display neutral face
  lc.setRow(0,0,nf[0]);
  lc.setRow(0,1,nf[1]);
  lc.setRow(0,2,nf[2]);
  lc.setRow(0,3,nf[3]);
  lc.setRow(0,4,nf[4]);
  lc.setRow(0,5,nf[5]);
  lc.setRow(0,6,nf[6]);
  lc.setRow(0,7,nf[7]);
  delay(delaytime);
  
  // Display happy face
  lc.setRow(0,0,hf[0]);
  lc.setRow(0,1,hf[1]);
  lc.setRow(0,2,hf[2]);
  lc.setRow(0,3,hf[3]);
  lc.setRow(0,4,hf[4]);
  lc.setRow(0,5,hf[5]);
  lc.setRow(0,6,hf[6]);
  lc.setRow(0,7,hf[7]);
  delay(delaytime);
}
 
void loop(){
  drawFaces();
}

Tagged With arduino max7219 dot matrix code , arduino led matrix display code , arduino 8x8 led matrix code , max7219 arduino code examples , 8x8 dot matrix display arduino , arduino led matrix max7219 code , 8x8 matrix arduino code , arduino 8*8 led matrix codes , 8x8 led matrix arduino code , dot matrix arduino code

This Article Has Been Shared 767 Times!

Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Arduino 8×8 LED Dot Matrix Display With MAX7219 : Code

  • DIY Basic Stand For TM1637 7 Segment LED Display Module

    Is Not It Risky To Use LED Display Unprotected? Here Is How To Build DIY Basic Stand For TM1637 7 Segment LED Display Module With Cardboard.

  • ATtiny Arduino Boards For Cost Saving Projects

    Ready to Use Cheap ATtiny Arduino Boards Available. Here is What to Know About ATtiny Arduino Boards For Cost Saving Projects Before Buying.

  • Arduino Programming Language Tutorial

    Arduino Programming Language Tutorial Explains Where From That “Language” Originated and Why We Talk About Writing Codes in C++, C Language.

  • List of Electronics Prototyping & Project Materials

    Our Illustrated List of Electronics Prototyping & Project Materials is a Helpful Guide to Those Who Lacks Conventional Course on Electronics.

  • 1602A LCD Display Arduino Connection (Blue Light White Text 16×2)

    Here is Detailed Steps on How to For 1602A LCD Display Arduino Connection. We Provided Guide on Soldering of Blue Light White Text Displays.

Additionally, performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Cyberpunk Aesthetics: What’s in it Special January 27, 2023
  • How to Do Electrical Layout Plan for Adding Smart Switches January 26, 2023
  • What is a Data Mesh? January 25, 2023
  • What is Vehicular Ad-Hoc Network? January 24, 2023
  • Difference Between Panel Light, COB Light, Track Light January 21, 2023

About This Article

Cite this article as: Abhishek Ghosh, "Arduino 8×8 LED Dot Matrix Display With MAX7219 : Code," in The Customize Windows, October 18, 2017, January 29, 2023, https://thecustomizewindows.com/2017/10/arduino-8x8-led-dot-matrix-display-with-max7219-code/.

Source:The Customize Windows, JiMA.in

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT