int led = 13;
int tombol = 3;
int jumlahTekanan;
void setup() {
// put your setup code here, to run once:
pinMode(led, OUTPUT);
pinMode(tombol, INPUT_PULLUP);
}
void loop() {
// put your main code here, to run repeatedly:
int buttonState = digitalRead(tombol);
if (buttonState == LOW)
{
jumlahTekanan ++;
delay(200);
if(jumlahTekanan==1)
{
digitalWrite(led, HIGH);
}
else if(jumlahTekanan==2)
{
digitalWrite(led, LOW);
jumlahTekanan=0;
}
}
}