int press=A1;
int rled=12;
int yled=7;
int bzr=A2;


void setup() {
// put your setup code here, to run once:

Serial.begin(9600);
pinMode(press,INPUT);
pinMode(rled,OUTPUT);
pinMode(yled,OUTPUT);
pinMode(bzr,OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
delay(300);
int x=analogRead(press)/3;
Serial.println("the value is -");
Serial.print(x);
if(x>=163)
{
digitalWrite(rled,HIGH);
digitalWrite(yled,LOW);
tone(bzr,x);
}
else
//if(x<=163)
{
digitalWrite(yled,HIGH);
digitalWrite(rled,LOW);
noTone(bzr);

}
}