Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "LedControlMS.h"
- #define CLK 3
- #define DIN 4
- #define CS 2
- #define PREMIERE_COLONNE 6
- #define NOMBRE_COLONNES 7
- #define MATRICE_VERTE 0
- #define MATRICE_ROUGE 1
- LedControl lc = LedControl(DIN, CLK, CS, 2);
- void setup()
- {
- pinMode(9, INPUT);
- pinMode(11, INPUT);
- }
- void loop()
- {
- int i=0;
- if(digitalRead(9) == LOW)
- {
- i--;
- lc.clearDisplay(0);
- lc.setLed(0, i, 0, true);
- }
- if(digitalRead(11) == LOW)
- {
- i++;
- lc.clearDisplay(0);
- lc.setLed(0, i, 0, true);
- }
- if(i<0 && i>7)
- {
- i == 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement