The code that is avaliable on the link:
volatile int state = HIGH;
volatile int flag = HIGH;
int count = 0;
void setup()
{
Serial.begin(9600);
pinMode(GREEN_LED, OUTPUT);
digitalWrite(GREEN_LED, state);
attachInterrupt(PUSH2, blink, FALLING); // Interrupt is fired whenever button is pressed
}
void loop()
{
digitalWrite(GREEN_LED, state); //LED starts ON
if(flag) {
count++;
Serial.println(count);
flag = LOW;
}
}
void blink()
{
state = !state;
flag = HIGH;
}
In this code, I am trying to press the pushbutton P1_3. But it is not showing any statu