Код для поиска

Lesson 23: Using a MAX7219 8-Digit Display | Arduino Step-by-Step Course

Lesson 23: Using a MAX7219 8-Digit Display | Arduino Step-by-Step Course

In this lecture, we learn how to use a MAX7219 8-digit LED display to display numbers and make a counter.

560-Lesson 23: Using a MAX7219 8-Digit Display | Arduino Step-by-Step Course
Язык: C++
/* 
 * Robojax Arduino Step By Step Course
 * Lesson 23, MAX7219 8-digit LED display 
 * 8-Digits LED Seven Segment Display Module based on MAX7219 using Arduino IDE
 *  
   Please watch video instruction here https://youtu.be/8znr77ScydM
 This code is available at http://robojax.com/course1/?vid=lecture11
 
with over 100 lectures free on YouTube. Watch it here: http://robojax.com/L/?id=338
Get the code for the course: http://robojax.com/L/?id=339  
 *  updated by Ahmad Shamshiri for Robojax 
 *  On Monday, September 16, 2019 in Ajax, Ontario, Canada
 *  You can get this code from Robojax.com
 *  
 *  Original Library source: https://github.com/ozhantr/DigitLedDisplay


If you found this tutorial helpful, please support me so I can continue creating.
Make a donation using PayPal: http://robojax.com/L/?id=64

 * Code is available at http://robojax.com/learn/arduino

 * This code is "AS IS" without warranty or liability. Free to be used as long as you keep this note intact.
 * This code has been downloaded from Robojax.com
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>. 
    

 */
#include "DigitLedDisplay.h"

/* Arduino Pin to Display Pin
   7 to DIN,
   6 to CS,
   5 to CLK */
#define DIN 5
#define CS 6
#define CLK 7   
DigitLedDisplay ld = DigitLedDisplay(DIN, CS, CLK);


void setup() {
//Robojax Arduino Step By Step Course http://robojax.com/L/?id=338
  /* Set the brightness min:1, max:15 */
  ld.setBright(6);

  /* Set the digit count */
  ld.setDigitLimit(8);

}

void loop() {

 //Robojax Arduino Step By Step Course http://robojax.com/L/?id=338

  /* Prints data to the display */
  ld.printDigit(12345678); 
  delay(3000);
  ld.clear();

  ld.printDigit(22222222);
  delay(500);
  ld.clear();

  ld.printDigit(44444444);
  delay(500);
  ld.clear();

  for (int i = 0; i < 100; i++) {
    ld.printDigit(i);

    /* Start From Digit 4 */
    ld.printDigit(i, 4);
    delay(50);

    
  }

  for (int i = 0; i <= 10; i++) {
    /* Display off */
    ld.off();
    delay(150);

    /* Display on */
    ld.on();
    delay(150);
  }

  /* Clear all display value */
  ld.clear();
  delay(500);

  for (long i = 0; i < 100; i++) {
    ld.printDigit(i);
    delay(25);
  }

  for (int i = 0; i <= 20; i++) {
    /* Select Digit 5 and write B01100011 */
    ld.write(5, B01100011);
    delay(200);

    /* Select Digit 5 and write B00011101 */
    ld.write(5, B00011101);
    delay(200);
  }

  /* Clear all display value */
  ld.clear();
  delay(500);

  ld.printDigit(2019, 3);
  delay(4000);

}// loop ends

Ресурсы и ссылки

Файлы📁

Нет доступных файлов.