すべてのメッセージ

BG431314227 17/12/2023
This is a very nice part. Had some trouble to find the right library for an Arduino Nano to get it to work. Here is the code: // Program to exercise the MD_MAX72XX library // configuration for Nano v3 with 12x 1088AS // // Uses most of the functions in the library #include // Turn on debug statements to the serial output #define DEBUG 1 #if DEBUG #define PRINT(s, x) { Serial.print(F(s)); Serial.print(x); } #define PRINTS(x) Serial.print(F(x)) #define PRINTD(x) Serial.println(x, DEC) #else #define PRINT(s, x) #define PRINTS(x) #define PRINTD(x) #endif // Define the number of devices we have in the chain and the hardware interface // NOTE: These pin numbers will probably not work with your hardware and may // need to be adapted #define HARDWARE_TYPE MD_MAX72XX::FC16_HW //#define HARDWARE_TYPE MD_MAX72XX::DR0CR0RR0_HW //#define HARDWARE_TYPE MD_MAX72XX::DR0CR0RR1_HW //#define HARDWARE_TYPE MD_MAX72XX::DR0CR1RR0_HW //#define HARDWARE_TYPE MD_MAX72XX::DR0CR1RR1_HW //#define HARDWARE_TYPE MD_MAX72XX::DR1CR0RR0_HW //#define HARDWARE_TYPE MD_MAX72XX::DR1CR0RR1_HW //#define HARDWARE_TYPE MD_MAX72XX::DR1CR1RR0_HW //#define HARDWARE_TYPE MD_MAX72XX::DR1CR1RR1_HW #define ver "FC16_HW" #define MAX_DEVICES 12 #define CLK_PIN 11 // or SCK #define DATA_PIN 12 // or MOSI #define CS_PIN 10 // or SS // SPI hardware interface MD_MAX72XX mx = MD_MAX72XX(HARDWARE_TYPE, CS_PIN, MAX_DEVICES); // Specific SPI hardware interface //MD_MAX72XX mx = MD_MAX72XX(HARDWARE_TYPE, SPI1, CS_PIN, MAX_DEVICES); // Arbitrary pins //MD_MAX72XX mx = MD_MAX72XX(HARDWARE_TYPE, DATA_PIN, CLK_PIN, CS_PIN, MAX_DEVICES); // We always wait a bit between updates of the display #define DELAYTIME 100 // in milliseconds void scrollText(const char *p) { uint8_t charWidth; uint8_t cBuf[8]; // this should be ok for all built-in fonts PRINTS("nScrolling text"); OOPS: cannot post more than 2000 characters... Anyway, most important stuff is here in the header
0
推奨事項
コメント (0)