当前位置:首页 > 科学研究 > 电子编程 > 正文内容

Arduino Project 019 - LED Dot Matrix Display - Basic Animation

RonWang3个月前 (09-24)电子编程148

So far you have dealt with individual 5mm LEDs. LEDs can also be obtained in a package known as a dot matrix display, the most popular being a matrix of 8x8 LEDs or 64 LEDs in total. You can also obtain bicolor dot matrix displays (e.g. red and green) or even RGB dot matrix displays, which can display any color and contains a total of 192 LEDs in a single display package. In this chapter, you are going to deal with a standard single color 8x8 dot matrix display and show you how to display images and text. You will start off with a simple demonstration of creating an animated image on an 88 display and then move onto more complex display projects. Along the way, you will learn the very important concept of multiplexing.

Project 19 – LED Dot Matrix Display – Basic Animation

/* Coding Ron Wang
   Sep.24th 2024
   Autaba support for coding hardware
   Project 19 LED Dot Matrix – Basic Animation
 */
#include <LedControl.h>
int DIN = 11;
int CS =  8;
int CLK = 12;
byte L[8]=     {0x7f,0x7f,0x7f,0x07,0x07,0x07,0x07,0x07}; 
byte dot[8]=   {0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00};
byte S[8]=     {0x7e,0x7e,0x60,0x7e,0x7e,0x06,0x7e,0x7e};
byte H[8]=     {0xe7,0xe7,0xe7,0xff,0xff,0xe7,0xe7,0xe7};
byte A[8]=     {0xe7,0xe7,0xff,0xff,0xe7,0xe7,0x7e,0x3c};
byte R[8]=     {0xc7,0xe7,0x7f,0x7f,0xe7,0xe7,0xff,0x7e};
byte T[8]=     {0x18,0x18,0x18,0x18,0x18,0x18,0xff,0xff};
LedControl lc=LedControl(DIN,CLK,CS,0);
void setup(){
 lc.shutdown(0,false);       //The MAX72XX is in power-saving mode on startup
 lc.setIntensity(0,15);      // Set the brightness to maximum value
 lc.clearDisplay(0);         // and clear the display
}
void loop(){ 
    byte smile[8]=   {0x3C,0x42,0xA5,0x81,0xA5,0x99,0x42,0x3C};
    byte neutral[8]= {0x3C,0x42,0xA5,0x81,0xBD,0x81,0x42,0x3C};
    byte frown[8]=   {0x3C,0x42,0xA5,0x81,0x99,0xA5,0x42,0x3C};
    
    printByte(smile);
     
    delay(1000);
    printByte(neutral);
    
    delay(1000);
    printByte(frown);    
    delay(1000);
   
    printEduc8s();
   
    lc.clearDisplay(0);
    
    delay(1000);
}
void printEduc8s()
{
  printByte(L);
  delay(1000);
  printByte(dot);
  delay(1000);
  printByte(S);
  delay(1000);
  printByte(H);
  delay(1000);
  printByte(A);
  delay(1000);
  printByte(R);
  delay(1000);
    printByte(A);
  delay(1000);
  printByte(T);
  delay(1000);
  printByte(H);
  delay(1000);
 
}
void printByte(byte character [])
{
  int i = 0;
  for(i=0;i<9;i++)
  {
    lc.setRow(0,i,character[i]);
  }
}

Arduino LED Dot Matrix Display Circuit

Arduino LED Dot Matrix Display Schematic

版权声明:本文为原创文章,版权归donstudio所有,欢迎分享本文,转载请保留出处!

本文链接:http://parentscn.com/?id=269

标签: Arduino

相关文章

Arduino Project 028B - Basic Stepper Control (Unipolar)

Arduino Project 028B - Basic Stepper Control (Unipolar)

In this very simple project, you will connect up a stepper motor and then get the Arduino to control...

Arduino Project 003 - LED Traffic Light

Arduino Project 003 - LED Traffic Light

You are now going to create a set of traffic lights that will change from green to red, via amber, a...

Arduino Project 016 - L293D Motor Driver IC

Arduino Project 016 - L293D Motor Driver IC

In the previous project, you used a transistor to control the motor. In this project, you are going...

 ​Arduino Project 048 - Human Body Infrared Detector and Relay Light

​Arduino Project 048 - Human Body Infrared Detector and Relay Light

Project 48 Human Body Infrared Detector and Relay Light/*  * Coding by Ronwang&...

Arduino Project 023B - Liquid Crystal Displays -Blink and Cursor

Arduino Project 023B - Liquid Crystal Displays -Blink and Cursor

Before wiring the LCD screen to your Arduino board we suggest to solder a pin header strip to the 14...

Arduino Project 035 - Keypad 4X4 or 4X3

Arduino Project 035 - Keypad 4X4 or 4X3

Most of the time we are used key, button, or switch to get input value in our projects. When we inte...

发表评论

访客

看不清,换一张

◎欢迎参与讨论,请在这里发表您的看法和观点。