void setup()
{
pinMode(A0 , INPUT_PULLUP);
int k = 3 ;
while (k <= 13)
{
pinMode(k , OUTPUT);
k++ ;
}
Serial.begin(9600);
Serial.println("Short/Long Press button");
}
void loop()
{
long t = 0 ;
bool a = digitalRead(A0);
while (a == 0)
{
delay(1);
t++ ;
if (100 < t && t < 1000)
{
tone(3 , 110);
noTone(3);
}
if (1500 < t)
{
tone(3 , 440);
noTone(3);
}
a = digitalRead(A0);
}
if (100 < t && t < 1000)
{
Serial.println("Short");
}
if (1100 < t)
{
Serial.println("Long");
}
}