int PB_PIN=5; int PB_CONDITION = 0; void setup() { // put your setup code here, to run once: pinMode(PB_PIN,INPUT_PULLUP); Serial.begin(115200); } void loop() { // put your main code here, to run repeatedly: PB_CONDITION=digitalRead(PB_PIN); Serial.println(PB_CONDITION); delay(100); }