const int buttonPin2 = A0;
const int buttonPin3= A1;
const int buttonPin4 = A2;
const int buttonPin5= A3;

const int piezo = A4;
//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);
    pinMode(piezo, OUTPUT);
}

void loop() {

    /*if(Serial.available()>0)
    {
      String s = Serial.readString();
      s.trim();
    if(s.equals("stop"))
      tone(piezo,60,1000);
    else
      noTone(piezo);
    }*/

    int dr = digitalRead(buttonPin2);
    if(dr != buttonState2)
    {
      if (buttonState2 == HIGH)
        Serial.println(1);
        buttonState2=dr;
    }

    dr = digitalRead(buttonPin3);
    if(dr != buttonState3)
    {
      if (buttonState3 == HIGH)
        Serial.println(2);
      buttonState3=dr;
    }
    dr = digitalRead(buttonPin4);
    if(dr != buttonState4)
    {
      if (buttonState4 == HIGH)
        Serial.println(3);
      buttonState4=dr;
    }

    dr = digitalRead(buttonPin5);
    if(dr != buttonState5)
    {
      if (buttonState5 == HIGH)
        Serial.println(4);
      buttonState5=dr;
    }
}