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 increasing and the buzzer will be on");
digitalWrite(buzzer,1);
}
else{
Serial.println("potentiometer value is constant and the buzzer will be off");
digitalWrite(buzzer,0);
}
}