//red button go left 4, blue right 2, green rotate 5, yellow hard drop 3, black slow drop 6
#include <LiquidCrystal_I2C.h>
#include <LedControl.h>
#include <AbleButtons.h>
int num_score = 0;
LiquidCrystal_I2C lcd(0x27, 16, 2);
int all_button[5] = {2, 3, 4, 5, 6}; //make all button in this array for loop
void setup() {
lcd.init(); //turn on lcd
lcd.backlight(); //turn on back light
for (int i = 0; i<5; i++) {
pinMode(all_button[i], INPUT); //set all button as input
}
}
void loop() {
for (int i = 0; i<5; i++) {
all_button[i] = digitalRead(all_button[i]);
}
score();
delay(100);
}
int score() { //show score on lcd (will fix later)
lcd.print("SCORE : ");
lcd.print(num_score);
delay(400);
lcd.clear();
}