const int buttonPin2 = 2;
const int buttonPin3= 3;
const int buttonPin4 = 4;
const int buttonPin5= 5;
//const int ledPin = 4;
int buttonState2 = 0;
int buttonState3 = 0;
int buttonState4 = 0;
int buttonState5 = 0;
int incomingByte = 0;
    
void setup(void) {
    Serial.begin(9600);
    pinMode(buttonPin2, INPUT);
    pinMode(buttonPin3, INPUT);
    pinMode(buttonPin4, INPUT);
    pinMode(buttonPin5, INPUT);
}

void loop() {
  int dr = digitalRead(buttonPin2);
  if(dr != buttonState2)
  {
    if (buttonState2 == HIGH) {
       //turn LED on:
      Serial.println(1);
    } else {
      // turn LED off:
      Serial.print(0);
    }
    buttonState2=dr;
  }

  dr = digitalRead(buttonPin3);
  if(dr != buttonState3)
  {
    if (buttonState3 == HIGH) {
       //turn LED on:
      Serial.println(2);
    } else {
      // turn LED off:
      Serial.print(0);
    }
    buttonState3=dr;
  }
  dr = digitalRead(buttonPin4);
  if(dr != buttonState4)
  {
    if (buttonState4 == HIGH) {
       //turn LED on:
      Serial.println(3);
    } else {
      // turn LED off:
      Serial.print(0);
    }
    buttonState4=dr;
  }

  dr = digitalRead(buttonPin5);
  if(dr != buttonState5)
  {
    if (buttonState5 == HIGH) {
       //turn LED on:
      Serial.println(4);
    } else {
      // turn LED off:
      Serial.print(0);
    }
    buttonState5=dr;
  }
  
  /*if (Serial.available() > 0) {
    digitalWrite(ledPin, HIGH);
     
    // read the incoming byte:
    incomingByte = Serial.read();
    // say what you got:
    Serial.println("I received: ");
    Serial.println(incomingByte, DEC);
  }*/
  /*if(Serial.available())
  {
     Serial.print("recu : "+Serial.readString());
     digitalWrite(ledPin, HIGH);
  }*/
}
