Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <DMD2.h>
- #include <SPI.h>
- #include <fonts/SystemFont5x7.h>
- #include <fonts/Droid_Sans_24.h>// font libaray
- int i = 0;
- SPIDMD dmd(1, 2);
- SPIDMD dmd1(1, 2);
- DMD_TextBox box(dmd, -4, 0, 32, 16); // x, y change text posistion [ Set Box (dmd, x, y, Height, Width)]
- const char *MESSAGE = "ABCD";
- void setup() {
- Serial.begin(115200);
- Serial.println("Starting");
- /////////////////////////////text display//////////////////////
- dmd.setBrightness(255); // Set brightness 0–255
- dmd.selectFont(SystemFont5x7); // Font used
- dmd.begin();
- //////////////////////////////////////////////////////////////
- //////////////////////////drawing box border//////////////////
- dmd1.setBrightness(255); // Set brightness 0–255
- dmd1.selectFont(SystemFont5x7); // Font used
- dmd1.begin();
- dmd1.drawBox(31, 31, 0, 0); //{x,y,} // drawing box bording led pannel
- }
- void loop() {
- scrolling();
- }
- void scrolling() {
- const char *next = MESSAGE;
- while (*next) {
- dmd.clearScreen();// clear screen
- if (i != 0) {
- box.print(*next); //print the led pannel
- }
- i++;
- delay(800); // letters speed changing
- next++;
- }
- }
Add Comment
Please, Sign In to add comment