hi i'm new with arduino and i have a problem with interrupts, i was testing this code:
int pin = 10;
volatile int state = LOW;
void setup()
{
pinMode(pin, OUTPUT);
attachInterrupt(0, blink, CHANGE);
}
void loop()
{
digitalWrite(pin, state);
}
void blink()
{
state = !state;
}
but im not sure about why the led change when i connect to ground, if i conect to 5 volts nothing happens, i have an arduinomega
thanks
Moderator edit:
[code] [/code] tags added.