i’m having trouble catching the sleep button interrupt.
this is my code,
[code]int pin = 8;
volatile int state = LOW;
void setup()
{
pinMode(pin, OUTPUT);
attachInterrupt(0, blink, CHANGE);
}
void loop()
{
digitalWrite(pin, state);
}
void blink()
{
state = !state;
}[/code]
i expect it to turn the onboard led on and off but it does not do this. please help. thanks!