Advertisement
B-Matt

Arduino - Matrix display & tipkalo

Dec 9th, 2016
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. #include "LedControl.h"
  2.  
  3. LedControl lc=LedControl(12,11,10,1);
  4. unsigned long delaytime=100;
  5.  
  6. void setup() {
  7.   lc.shutdown(0,false);
  8.   lc.setIntensity(0,8);
  9.   lc.clearDisplay(0);
  10.  
  11.   pinMode(2, INPUT_PULLUP);
  12.   attachInterrupt(digitalPinToInterrupt(2), pali, CHANGE);
  13. }
  14.  
  15. int i=0, j=0;
  16. void loop() {
  17. }
  18.  
  19. void pali() {
  20.   lc.setLed(0,i,j,1);
  21.   i++;
  22.   if(i>8) {
  23.     i=0;
  24.     j++;
  25.     if(j>8) {
  26.       j=0;
  27.     }
  28.   }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement