#include <LiquidCrystal_I2C.h>
#define I2C_ADDR 0x27
#define LCD_COLUMNS 16
#define LCD_LINES 2
LiquidCrystal_I2C lcd(I2C_ADDR, LCD_COLUMNS, LCD_LINES);
bool test[8] {true,true,true,true,true,true,true,true};
void setup() {
lcd.init();
lcd.backlight();
DDRD = 0;
PORTD = 0xFF;
}
void loop() {
int amount = 0;
for (int i = 0; i < 8; i++) {
if ((PIND & (1<<i)) == LOW && test[i] == true) {
test[i] = false;
} else if ((PIND & (1<<i)) != LOW && test[i] == false) {
test[i] = true;
}
lcd.setCursor(i, 0);
lcd.print(test[i]);
}
}