หากต้องการใบเสนอราคา / ใบแจ้งหนี้ ติดต่อได้ทาง LINE Official: @mikroelec |
![]() |
รหัสสินค้า | SKU-03076 |
หมวดหมู่ | LED dot matrix |
ราคา | 100.00 บาท |
สถานะสินค้า | พร้อมส่ง |
ลงสินค้า | 1 มี.ค. 2568 |
อัพเดทล่าสุด | 2 มี.ค. 2568 |
จำนวน | ชิ้น |
Specifications:
/*** @author Teerapong Singthong <st.teerapong@gmail.com>*/#include <avr/pgmspace.h>#include <LedControl.h>const int numDevices = 4; // number of MAX7219s usedconst long scrollDelay = 50; // adjust scrolling speedunsigned long bufferLong [14] = {0};/*pin 12 - DataInpin 11 - CLKpin 10 - CSVCC - 5VGND - GND*/LedControl lc = LedControl(12, 11, 10, numDevices);const unsigned char scrollText[] PROGMEM = {" Welcome to MikroElec.com "};void setup() {for (int x = 0; x < numDevices; x++) {lc.shutdown(x, false); //The MAX72XX is in power-saving mode on startuplc.setIntensity(x, 0); // Set the brightness to default valuelc.clearDisplay(x); // and clear the display}}void loop() {scrollMessage(scrollText);}/*** Define Set of Characters*/const unsigned char font5x7 [] PROGMEM = { // Numeric Font Matrix (Arranged as 7x font data + 1x kerning data)B00000000, //Space (Char 0x20)B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,6,B10000000, //!B10000000,B10000000,B10000000,B00000000,B00000000,B10000000,2,B10100000, //"B10100000,B10100000,B00000000,B00000000,B00000000,B00000000,4,B01010000, //#B01010000,B11111000,B01010000,B11111000,B01010000,B01010000,6,B00100000, //$B01111000,B10100000,B01110000,B00101000,B11110000,B00100000,6,B11000000, //%B11001000,B00010000,B00100000,B01000000,B10011000,B00011000,6,B01100000, //&B10010000,B10100000,B01000000,B10101000,B10010000,B01101000,6,B11000000, //'B01000000,B10000000,B00000000,B00000000,B00000000,B00000000,3,B00100000, //(B01000000,B10000000,B10000000,B10000000,B01000000,B00100000,4,B10000000, //)B01000000,B00100000,B00100000,B00100000,B01000000,B10000000,4,B00000000, //*B00100000,B10101000,B01110000,B10101000,B00100000,B00000000,6,B00000000, //+B00100000,B00100000,B11111000,B00100000,B00100000,B00000000,6,B00000000, //,B00000000,B00000000,B00000000,B11000000,B01000000,B10000000,3,B00000000, //-B00000000,B11111000,B00000000,B00000000,B00000000,B00000000,6,B00000000, //.B00000000,B00000000,B00000000,B00000000,B11000000,B11000000,3,B00000000, ///B00001000,B00010000,B00100000,B01000000,B10000000,B00000000,6,B01110000, //0B10001000,B10011000,B10101000,B11001000,B10001000,B01110000,6,B01000000, //1B11000000,B01000000,B01000000,B01000000,B01000000,B11100000,4,B01110000, //2B10001000,B00001000,B00010000,B00100000,B01000000,B11111000,6,B11111000, //3B00010000,B00100000,B00010000,B00001000,B10001000,B01110000,6,B00010000, //4B00110000,B01010000,B10010000,B11111000,B00010000,B00010000,6,B11111000, //5B10000000,B11110000,B00001000,B00001000,B10001000,B01110000,6,B00110000, //6B01000000,B10000000,B11110000,B10001000,B10001000,B01110000,6,B11111000, //7B10001000,B00001000,B00010000,B00100000,B00100000,B00100000,6,B01110000, //8B10001000,B10001000,B01110000,B10001000,B10001000,B01110000,6,B01110000, //9B10001000,B10001000,B01111000,B00001000,B00010000,B01100000,6,B00000000, //:B11000000,B11000000,B00000000,B11000000,B11000000,B00000000,3,B00000000, //;B11000000,B11000000,B00000000,B11000000,B01000000,B10000000,3,B00010000, //<B00100000,B01000000,B10000000,B01000000,B00100000,B00010000,5,B00000000, //=B00000000,B11111000,B00000000,B11111000,B00000000,B00000000,6,B10000000, //>B01000000,B00100000,B00010000,B00100000,B01000000,B10000000,5,B01110000, //?B10001000,B00001000,B00010000,B00100000,B00000000,B00100000,6,B01110000, //@B10001000,B00001000,B01101000,B10101000,B10101000,B01110000,6,B01110000, //AB10001000,B10001000,B10001000,B11111000,B10001000,B10001000,6,B11110000, //BB10001000,B10001000,B11110000,B10001000,B10001000,B11110000,6,B01110000, //CB10001000,B10000000,B10000000,B10000000,B10001000,B01110000,6,B11100000, //DB10010000,B10001000,B10001000,B10001000,B10010000,B11100000,6,B11111000, //EB10000000,B10000000,B11110000,B10000000,B10000000,B11111000,6,B11111000, //FB10000000,B10000000,B11110000,B10000000,B10000000,B10000000,6,B01110000, //GB10001000,B10000000,B10111000,B10001000,B10001000,B01111000,6,B10001000, //HB10001000,B10001000,B11111000,B10001000,B10001000,B10001000,6,B11100000, //IB01000000,B01000000,B01000000,B01000000,B01000000,B11100000,4,B00111000, //JB00010000,B00010000,B00010000,B00010000,B10010000,B01100000,6,B10001000, //KB10010000,B10100000,B11000000,B10100000,B10010000,B10001000,6,B10000000, //LB10000000,B10000000,B10000000,B10000000,B10000000,B11111000,6,B10001000, //MB11011000,B10101000,B10101000,B10001000,B10001000,B10001000,6,B10001000, //NB10001000,B11001000,B10101000,B10011000,B10001000,B10001000,6,B01110000, //OB10001000,B10001000,B10001000,B10001000,B10001000,B01110000,6,B11110000, //PB10001000,B10001000,B11110000,B10000000,B10000000,B10000000,6,B01110000, //QB10001000,B10001000,B10001000,B10101000,B10010000,B01101000,6,B11110000, //RB10001000,B10001000,B11110000,B10100000,B10010000,B10001000,6,B01111000, //SB10000000,B10000000,B01110000,B00001000,B00001000,B11110000,6,B11111000, //TB00100000,B00100000,B00100000,B00100000,B00100000,B00100000,6,B10001000, //UB10001000,B10001000,B10001000,B10001000,B10001000,B01110000,6,B10001000, //VB10001000,B10001000,B10001000,B10001000,B01010000,B00100000,6,B10001000, //WB10001000,B10001000,B10101000,B10101000,B10101000,B01010000,6,B10001000, //XB10001000,B01010000,B00100000,B01010000,B10001000,B10001000,6,B10001000, //YB10001000,B10001000,B01010000,B00100000,B00100000,B00100000,6,B11111000, //ZB00001000,B00010000,B00100000,B01000000,B10000000,B11111000,6,B11100000, //[B10000000,B10000000,B10000000,B10000000,B10000000,B11100000,4,B00000000, //(Backward Slash)B10000000,B01000000,B00100000,B00010000,B00001000,B00000000,6,B11100000, //]B00100000,B00100000,B00100000,B00100000,B00100000,B11100000,4,B00100000, //^B01010000,B10001000,B00000000,B00000000,B00000000,B00000000,6,B00000000, //_B00000000,B00000000,B00000000,B00000000,B00000000,B11111000,6,B10000000, //`B01000000,B00100000,B00000000,B00000000,B00000000,B00000000,4,B00000000, //aB00000000,B01110000,B00001000,B01111000,B10001000,B01111000,6,B10000000, //bB10000000,B10110000,B11001000,B10001000,B10001000,B11110000,6,B00000000, //cB00000000,B01110000,B10001000,B10000000,B10001000,B01110000,6,B00001000, //dB00001000,B01101000,B10011000,B10001000,B10001000,B01111000,6,B00000000, //eB00000000,B01110000,B10001000,B11111000,B10000000,B01110000,6,B00110000, //fB01001000,B01000000,B11100000,B01000000,B01000000,B01000000,6,B00000000, //gB01111000,B10001000,B10001000,B01111000,B00001000,B01110000,6,B10000000, //hB10000000,B10110000,B11001000,B10001000,B10001000,B10001000,6,B01000000, //iB00000000,B11000000,B01000000,B01000000,B01000000,B11100000,4,B00010000, //jB00000000,B00110000,B00010000,B00010000,B10010000,B01100000,5,B10000000, //kB10000000,B10010000,B10100000,B11000000,B10100000,B10010000,5,B11000000, //lB01000000,B01000000,B01000000,B01000000,B01000000,B11100000,4,B00000000, //mB00000000,B11010000,B10101000,B10101000,B10001000,B10001000,6,B00000000, //nB00000000,B10110000,B11001000,B10001000,B10001000,B10001000,6,B00000000, //oB00000000,B01110000,B10001000,B10001000,B10001000,B01110000,6,B00000000, //pB00000000,B11110000,B10001000,B11110000,B10000000,B10000000,6,B00000000, //qB00000000,B01101000,B10011000,B01111000,B00001000,B00001000,6,B00000000, //rB00000000,B10110000,B11001000,B10000000,B10000000,B10000000,6,B00000000, //sB00000000,B01110000,B10000000,B01110000,B00001000,B11110000,6,B01000000, //tB01000000,B11100000,B01000000,B01000000,B01001000,B00110000,6,B00000000, //uB00000000,B10001000,B10001000,B10001000,B10011000,B01101000,6,B00000000, //vB00000000,B10001000,B10001000,B10001000,B01010000,B00100000,6,B00000000, //wB00000000,B10001000,B10101000,B10101000,B10101000,B01010000,6,B00000000, //xB00000000,B10001000,B01010000,B00100000,B01010000,B10001000,6,B00000000, //yB00000000,B10001000,B10001000,B01111000,B00001000,B01110000,6,B00000000, //zB00000000,B11111000,B00010000,B00100000,B01000000,B11111000,6,B00100000, //{B01000000,B01000000,B10000000,B01000000,B01000000,B00100000,4,B10000000, //|B10000000,B10000000,B10000000,B10000000,B10000000,B10000000,2,B10000000, //}B01000000,B01000000,B00100000,B01000000,B01000000,B10000000,4,B00000000, //~B00000000,B00000000,B01101000,B10010000,B00000000,B00000000,6,B01100000, // (Char 0x7F)B10010000,B10010000,B01100000,B00000000,B00000000,B00000000,5};void scrollFont() {for (int counter = 0x20; counter < 0x80; counter++) {loadBufferLong(counter);delay(500);}}// Scroll Messagevoid scrollMessage(const unsigned char * messageString) {int counter = 0;int myChar = 0;do {// read back a charmyChar = pgm_read_byte_near(messageString + counter);if (myChar != 0) {loadBufferLong(myChar);}counter++;}while (myChar != 0);}// Load character into scroll buffervoid loadBufferLong(int ascii) {if (ascii >= 0x20 && ascii <= 0xff) {for (int a = 0; a < 7; a++) { // Loop 7 times for a 5x7 fontunsigned long c = pgm_read_byte_near(font5x7 + ((ascii - 0x20) * 8) + a); // Index into character table to get row dataunsigned long x = bufferLong [a * 2]; // Load current scroll bufferx = x | c; // OR the new character onto end of currentbufferLong [a * 2] = x; // Store in buffer}byte count = pgm_read_byte_near(font5x7 + ((ascii - 0x20) * 8) + 7); // Index into character table for kerning datafor (byte x = 0; x < count; x++) {rotateBufferLong();printBufferLong();delay(scrollDelay);}}}// Rotate the buffervoid rotateBufferLong() {for (int a = 0; a < 7; a++) { // Loop 7 times for a 5x7 fontunsigned long x = bufferLong [a * 2]; // Get low buffer entrybyte b = bitRead(x, 31); // Copy high order bit that gets lost in rotationx = x << 1; // Rotate left one bitbufferLong [a * 2] = x; // Store new low bufferx = bufferLong [a * 2 + 1]; // Get high buffer entryx = x << 1; // Rotate left one bitbitWrite(x, 0, b); // Store saved bitbufferLong [a * 2 + 1] = x; // Store new high buffer}}// Display Buffer on LED matrixvoid printBufferLong() {for (int a = 0; a < 7; a++) { // Loop 7 times for a 5x7 fontunsigned long x = bufferLong [a * 2 + 1]; // Get high buffer entrybyte y = x; // Mask off first characterlc.setRow(3, a, y); // Send row to relevent MAX7219 chipx = bufferLong [a * 2]; // Get low buffer entryy = (x >> 24); // Mask off second characterlc.setRow(2, a, y); // Send row to relevent MAX7219 chipy = (x >> 16); // Mask off third characterlc.setRow(1, a, y); // Send row to relevent MAX7219 chipy = (x >> 8); // Mask off forth characterlc.setRow(0, a, y); // Send row to relevent MAX7219 chip}}
หน้าที่เข้าชม | 563,672 ครั้ง |
ผู้ชมทั้งหมด | 321,315 ครั้ง |
ร้านค้าอัพเดท | 19 ต.ค. 2568 |