32x8 LED DOT MATRIX WITH MAX7219 USING ARDUINO

LED Dot Matrix using arduino

Required Parts:
Software:
1.Arduino IDE                           
2.MAX72xx Panel Library
3.Adafruit-GFX-Library-master 

download link:
1.https://www.arduino.cc/en/Main/Donate
2.https://github.com/markruys/arduino-Max72xxPanel
3.https://github.com/adafruit/Adafruit-GFX-Library

Hardware:
1.Arduino Board
2.MAX7219 32x8 LED Matrix Display
3.Jumper wire
4.USB Cable
led matrix display using max7219
MAX7219 Module

Arduino Code:

#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Max72xxPanel.h>

int pinCS = 10; // Attach CS to this pin, DIN to MOSI and CLK to SCK 
int numberOfHorizontalDisplays = 1;
int numberOfVerticalDisplays = 4;

Max72xxPanel matrix = Max72xxPanel(pinCS, numberOfHorizontalDisplays, numberOfVerticalDisplays);

String tape = "narayanan";
int wait = 250; // In milliseconds

int spacer = 1;
int width = 5 + spacer; // The font width is 5 pixels

void setup() {

  matrix.setIntensity(0.5); // Use a value between 0 and 15 for brightness

// Adjust to your own needs
//  matrix.setPosition(0, 0, 0); // The first display is at <0, 0>
//  matrix.setPosition(1, 1, 0); // The second display is at <1, 0>
//  matrix.setPosition(2, 2, 0); // The third display is at <2, 0>
//  matrix.setPosition(3, 3, 0); // And the last display is at <3, 0>
//  ...
//  matrix.setRotation(0, 2);    // The first display is position upside down
 matrix.setRotation(3);    // The same hold for the last display
}

void loop() {

  for ( int i = 0 ; i < width * tape.length() + matrix.width() - 1 - spacer; i++ ) {

    matrix.fillScreen(LOW);

    int letter = i / width;
    int x = (matrix.width() - 1) - i % width;
    int y = (matrix.height() - 8) / 2; // center the text vertically

    while ( x + width - spacer >= 0 && letter >= 0 ) {
      if ( letter < tape.length() ) {
        matrix.drawChar(x, y, tape[letter], HIGH, LOW, 1);
      }

      letter--;
      x -= width;
    }

    matrix.write(); // Send bitmap to display

    delay(wait);
  }

}

4 comments:

  1. Merci beaucoup de nous avoir aidé

    ReplyDelete
  2. hi can you help trying to use this with software called simhub. but display all wrong,
    i have tried simhubs own setup and dosent work.
    do you have a working sketch to work with sim hub , for data i.e spped revs or fuel or gears
    regards . ps have led connected to a uno r3 via usb to pc and simhub

    ReplyDelete
  3. I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article. Wet Mop

    ReplyDelete
  4. Advanced solutions for modern circuit board designs. Metal Core PCB Solutions

    ReplyDelete