Flipping the state of Pin 0 with this script does not invert the LED. Any help appreciated:
Code:
#include <avr/io.h>
#include <avr/interrupt.h>
volatile bool LED_State = LOW;
void setup() {
// put your setup code here, to run once:
pinMode(0, INPUT);
attachInterrupt(digitalPinToInterrupt(0), startBit_isr, FALLING);
pinMode(23, OUTPUT); // LED for debugging
LED_State = HIGH;
digitalWrite(23, LED_State);
sei();
}
void loop() {
// put your main code here, to run repeatedly:
delay(1000);
}
void startBit_isr()
{
LED_State = !LED_State;
digitalWrite(23, LED_State);
}