#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);

void setup() {
PIND = 0xFF;

}
bool test_1 = true;
int x = 0;

 lcd.init();
void loop() {

if((DDRD &= 0x00) != 0 || test_1 == true){
  test_1 = false;
  x++;
lcd.print("1");
}else if((DDRD &= 0x00) != 0 || test_1 == false){
  test_1 = true;
  x--;
  lcd.print("0");
}
}