Advertisement
LeventeDaradici

Dot Matrix LED display MAX 7219 - Arduino

Jun 29th, 2021
337
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.78 KB | None | 0 0
  1. #include <MD_Parola.h>
  2. #include <MD_MAX72xx.h>
  3. #include <SPI.h>
  4.  
  5. #define HARDWARE_TYPE MD_MAX72XX::FC16_HW
  6. #define MAX_DEVICES 4
  7. #define CS_PIN 3
  8.  
  9. MD_Parola myDisplay = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
  10.  
  11. void setup() {
  12.   myDisplay.begin();
  13.   myDisplay.setIntensity(0);
  14.   myDisplay.displayClear();
  15. }
  16.  
  17. void loop() {
  18.   myDisplay.setTextAlignment(PA_CENTER);
  19.   myDisplay.print("Center");
  20.   delay(2000);
  21.   myDisplay.setTextAlignment(PA_LEFT);
  22.   myDisplay.print("Left");
  23.   delay(2000);
  24.   myDisplay.setTextAlignment(PA_RIGHT);
  25.   myDisplay.print("Right");
  26.   delay(2000);
  27.   myDisplay.setTextAlignment(PA_CENTER);
  28.   myDisplay.setInvert(true);
  29.   myDisplay.print("Invert");
  30.   delay(2000);
  31.   myDisplay.setInvert(false);
  32.   myDisplay.print("Levy");
  33.   delay(2000);
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement