#include <LedControl.h>
LedControl lc = LedControl(11, 13, 10, 1);
#define LEFT_BTN 2
#define RIGHT_BTN 3
void setup() {
Serial.begin(9600);
lc.shutdown(0, false);
lc.setIntensity(0, 8);
lc.clearDisplay(0);
pinMode(LEFT_BTN, INPUT_PULLUP);
pinMode(RIGHT_BTN, INPUT_PULLUP);
}
void loop() {
lc.clearDisplay(0);
if (digitalRead(LEFT_BTN) == LOW) {
lc.setLed(0, 7, 2, true);
Serial.println("LEFT");
}
if (digitalRead(RIGHT_BTN) == LOW) {
lc.setLed(0, 7, 5, true);
Serial.println("RIGHT");
}
delay(50);
}