LED Matrix Driver MAX7219 IC Driver Module + LED Dot Matrix 8x8 ขนาด 32mm x 32mm 4 ชุด พร้อมสายไฟ
โมดูล LED 3mmDot Matrix 8x8 ดวง ขนาดจอ เส้นทะแยงมุม 40x40 มิลลิเมตร สามารถใช้งานเดี่ยว ๆ หรือนำมาเรียงต่อกันเพื่อทำไฟวิ่งแสดงข้อความได้ ใช่ง่าย มีตัวอย่างและโคดการใช้งาน
วิธีการต่ออุปกรณ์ สอนใช้งาน Arduino LED Matrix Driver MAX7219 แสงผลตัวเลข ตัวอักษร
Arduino -> LED Matrix Driver MAX7219
- 5V -> Vcc
- GND -> GND
- ขา11 -> DIN
- ขา10 -> CS
- ขา13 -> CLK
โหลด Library สอนใช้งาน Arduino LED Matrix Driver MAX7219 แสงผลตัวเลข ตัวอักษร
ให้ต่ออุปกรณ์ตามรูปข้างบน แล้ว อัพโหลดโค้ดด้านล่าง ลงบอร์ด Arduino
1
// Demo of MAX7219_Dot_Matrix library - sideways scrolling
3
// Date: 2 October 2015
5
// Scrolls a pixel at a time.
8
#include <bitBangedSPI.h>
9
#include <MAX7219_Dot_Matrix.h>
10
const byte chips = 12;
12
// 12 chips (display modules), hardware SPI with load on D10
13
MAX7219_Dot_Matrix display (chips, 10); // Chips / LOAD
15
const char message [] = "www.myarduino.net 1234567890";
22
unsigned long lastMoved = 0;
23
unsigned long MOVE_INTERVAL = 20; // mS
28
display.sendSmooth (message, messageOffset);
30
// next time show one pixel onwards
31
if (messageOffset++ >= (int) (strlen (message) * 8))
32
messageOffset = - chips * 8;
33
} // end of updateDisplay
38
// update display if time is up
39
if (millis () - lastMoved >= MOVE_INTERVAL)
42
lastMoved = millis ();
45
// do other stuff here


วิธีการต่อใช้งาน Arduino LED Matrix MAX7219
Arduino -> LED Matrix MAX7219
- 5V-> VCC
- GND -> GND
- ขา 12 - DataIn
- pin 11 - CLK
- pin 10 - CS
โหลด Library LED Matrix MAX7219 ติดตั้งลง Arduino IDE
1
//We always have to include the library
2
#include "LedControl.h"
5
Now we need a LedControl to work with.
6
***** These pin numbers will probably not work with your hardware *****
7
pin 12 is connected to the DataIn
8
pin 11 is connected to the CLK
9
pin 10 is connected to LOAD
10
We have only a single MAX72XX.
12
LedControl lc=LedControl(12,11,10,1);
14
/* we always wait a bit between updates of the display */
15
unsigned long delaytime=100;
19
The MAX72XX is in power-saving mode on startup,
20
we have to do a wakeup call
23
/* Set the brightness to a medium values */
25
/* and clear the display */
30
This method will display the characters for the
31
word "Arduino" one after the other on the matrix.
32
(you need at least 5x7 leds to see the whole chars)
34
void writeArduinoOnMatrix() {
35
/* here is the data for the characters */
36
byte a[5]={B01111110,B10001000,B10001000,B10001000,B01111110};
37
byte r[5]={B00111110,B00010000,B00100000,B00100000,B00010000};
38
byte d[5]={B00011100,B00100010,B00100010,B00010010,B11111110};
39
byte u[5]={B00111100,B00000010,B00000010,B00000100,B00111110};
ร้านค้านี้ยังไม่ได้กำหนดวิธีการชำระเงิน กรุณา
ติดต่อกับทางร้าน เกี่ยวกับรายละเอียดในการชำระเงิน
ทางร้านยังไม่ได้ทำการเพิ่มบัญชีรับเงิน กรุณาติดต่อ
เจ้าของร้าน