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

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

  dr = digitalRead(buttonPin3);
  if(dr != buttonState3)
  {
    if (buttonState3 == HIGH) {
       //turn LED on:
      Serial.println(3);
    } else {
      // turn LED off:
      Serial.print(0);
    }
    buttonState3=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);
  }
}