Lab_interaccio/2008/aguaaa/aguaaa.pde
Miguel Angel de Heras 451795bb92 Second commit
2025-03-05 15:57:19 +01:00

26 lines
476 B
Plaintext

int onoff = 4; // select the input pin for the potentiometer
int sens = 0;
int val = 0;
void setup() {
Serial.begin(19200);
pinMode(onoff, OUTPUT); // declare the ledPin as an OUTPUT
}
void loop() {
val = analogRead(sens);
Serial.println(val);
if (val>=200){
digitalWrite(onoff, HIGH);
delay(50);
digitalWrite(onoff, LOW);
}
/*delay(4000);
digitalWrite(onoff, HIGH);
delay(50);
digitalWrite(onoff, LOW);*/
}