Advertisement
aidanquayle

Essential Code

Dec 30th, 2013
475
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. #include "SPI.h"
  2. #include "DMD.h"
  3. #include "TimerOne.h"
  4. #include "Arial_black_16.h"<arial_black_16.h>
  5. // you can remove the fonts if unused
  6. #include "SystemFont5x7.h"
  7. #define DISPLAYS_ACROSS 1
  8. #define DISPLAYS_DOWN 1
  9. /* change these values if you have more than one DMD connected */
  10. DMD dmd(DISPLAYS_ACROSS,DISPLAYS_DOWN);
  11.  
  12. void ScanDMD()
  13. {
  14. dmd.scanDisplayBySPI();
  15. }
  16.  
  17. void setup()
  18. {
  19. Timer1.initialize( 5000 );
  20. /*period in microseconds to call ScanDMD. Anything longer than 5000 (5ms) and you can see flicker.*/
  21.  
  22. Timer1.attachInterrupt( ScanDMD );
  23. /*attach the Timer1 interrupt to ScanDMD which goes to dmd.scanDisplayBySPI()*/
  24.  
  25. dmd.clearScreen( true );
  26. /* true is normal (all pixels off), false is negative (all pixels on) */
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement