/**
  Arduino Uno PIND register demo

  https://wokwi.com/arduino/projects/314168546236039745

  Copyright (C) 2021, Uri Shaked.
*/

#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27, 16, 2);

void setup() {
  lcd.init();
  lcd.backlight();
  lcd.println("PIND value:");
  pinMode(0, INPUT_PULLUP);
  pinMode(1, INPUT_PULLUP);
  pinMode(2, INPUT_PULLUP);
  pinMode(3, INPUT_PULLUP);
  pinMode(4, INPUT_PULLUP);
  pinMode(5, INPUT_PULLUP);
  pinMode(6, INPUT_PULLUP);
  pinMode(7, INPUT_PULLUP);
}

int value = -1;
void loop() {
  if (PIND != value) {
    lcd.setCursor(6, 1);
    lcd.print(PIND);
    lcd.print("   ");
    value = PIND;
  }
}