Mạch hiển thị 4 led ma trận MAX7219
THÔNG SỐ KỸ THUẬT
- IC MAX7219
- Nguồn cấp: 5VDC.
- Tín hiệu: nối tiếp Serial ba chân DIN, CS, CLK, mức tín hiệu TTL.
- Ma trận: 4 Led ma trận 8×8 màu đỏ.
- Kích thước: 12.8×3.2×1.3cm.
SƠ ĐỒ KẾT NỐI

——————–CODE THAM KHẢO——————
/* * Kết nối:* MAX7219 Uno Mega * VCC 5V 5V * GND GND GND * CS 10 53 * DIN 11 51 * CLK 13 52*/#include #include #include int pinCS = 10; // Attach CS to this pin, DIN to MOSI and CLK to SCK (cf http://arduino.cc/en/Reference/SPI )int numberOfHorizontalDisplays = 1; //số trong Hiển thị theo chiều ngangint numberOfVerticalDisplays = 4; // Số trong hiển thị theo chiều dọc.Max72xxPanel matrix = Max72xxPanel(pinCS, numberOfHorizontalDisplays, numberOfVerticalDisplays); // cấu hình matrixString tape = "dientuttq.com"; // ký tự muốn truyền lên matrixint wait = 100; // thời gian chạy chữ. int spacer = 1; // khoảng cách cách chữint width = 5 + spacer; // độ rộng của font là 5 fixel void setup() { matrix.setIntensity(15); // cài đặt giá trị độ tương phản từ 0 đến 15. // điều chỉnh hiển thị theo nhu câu của người dùng. // matrix.setPosition(0, 1, 3); // 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); // Màn hình hiển thị đầu tiên là vị trí đảo ngược 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); }}
![[HCM]Mạch Hiển Thị 4 Led Ma Trận MAX7219](https://vn-test-11.slatic.net/p/9b1d207bc8dabfedbb375481b3354b5e.jpg)



![[Combo 10] Quang trở Cảm Biến Ánh Sáng](https://sg-test-11.slatic.net/p/1b489839a8ce8a88b433635a5b8206b6.jpg)











