int sp=32;
int buzzer=15;
int threshold=845;
void setup(){
pinMode(sp,INPUT);
pinMode(buzzer, OUTPUT);
Serial.begin(9600);
}
void loop(){
int g=analogRead(sp);
Serial.println(g);
if(g>threshold){
Serial.println("POTENTIOMETER value is increasing and the buzzer will be on");
digitalWrite(buzzer,1);
}
else{
Serial.println("potentiometer values is constant and the buzzer will be in off position");
digitalWrite(buzzer,0);
}
}