Sebuahhobi98

dmd2 ESP8266

Oct 8th, 2019
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. #include <DMD2.h>
  2. #include <SPI.h>
  3. #include <fonts/SystemFont5x7.h>
  4. #include <fonts/Droid_Sans_24.h>// font libaray
  5.  
  6. int i = 0;
  7.  
  8. SPIDMD dmd(1, 2);
  9. SPIDMD dmd1(1, 2);
  10.  
  11.  
  12. DMD_TextBox box(dmd, -4, 0, 32, 16); // x, y change text posistion [ Set Box (dmd, x, y, Height, Width)]
  13. const char *MESSAGE = "ABCD";
  14.  
  15. void setup() {
  16. Serial.begin(115200);
  17. Serial.println("Starting");
  18.  
  19. /////////////////////////////text display//////////////////////
  20. dmd.setBrightness(255); // Set brightness 0–255
  21. dmd.selectFont(SystemFont5x7); // Font used
  22. dmd.begin();
  23. //////////////////////////////////////////////////////////////
  24. //////////////////////////drawing box border//////////////////
  25. dmd1.setBrightness(255); // Set brightness 0–255
  26. dmd1.selectFont(SystemFont5x7); // Font used
  27. dmd1.begin();
  28. dmd1.drawBox(31, 31, 0, 0); //{x,y,} // drawing box bording led pannel
  29. }
  30.  
  31. void loop() {
  32. scrolling();
  33. }
  34.  
  35. void scrolling() {
  36. const char *next = MESSAGE;
  37. while (*next) {
  38. dmd.clearScreen();// clear screen
  39. if (i != 0) {
  40. box.print(*next); //print the led pannel
  41. }
  42. i++;
  43. delay(800); // letters speed changing
  44. next++;
  45. }
  46. }
Add Comment
Please, Sign In to add comment