// int buzzPin = 8;
// int number;
// String msg1 = "Introduce tu numero: ";
// int dt = 1000;
// int pot = A1;
// void setup() {
// Serial.begin(9600);
// pinMode(buzzPin, OUTPUT);
// }
// void loop() {
// Serial.println(msg1);
// while (Serial.available() == 0) {
// }
// number = Serial.parseInt();
// if (number > 10) {
// digitalWrite(buzzPin, HIGH);
// digitalWrite(buzzPin, LOW);
// delay(dt);
// }
// }
int buzzPin = 8;
int potVal;
int potPin = A1;
void setup() {
Serial.begin(9600);
pinMode(buzzPin, OUTPUT);
pinMode(potPin, INPUT);
}
void loop() {
potVal = analogRead(potPin);
Serial.println(potVal);
while (potVal > 1000) {
digitalWrite(buzzPin, HIGH);
potVal = analogRead(potPin);
Serial.println(potVal);
}
digitalWrite(buzzPin, LOW);
}