void setup()
{ pinMode(13, OUTPUT); pinMode(6, INPUT);
Serial.begin(9600);
}
void loop() { Serial.println(“premi il pulsante per fermare il lampeggio”); int conta=blink(600); Serial.println(conta); while(digitalRead(6)==HIGH){ }
}
|
int blink(int time){
int a=0; while(digitalRead(6)== LOW){ digitalWrite(13, HIGH); delay(time/2); digitalWrite(13, LOW); delay(time/2); a++; } return a; } |