Category: Interrupts
Variables used in interrupts
Declaring a variable which will be used in an interrupt volatile unsigned int my_irq_variable = 0;
UNO-Timer/Counter 1 Interrupt
Using TimerOne Library See here Using Code Initialise Turning interrupt on Turning interrupt off Interrupt function
UNO-Comparator Interrupt
Initialise //Enable gobal interrupts (should already be enabled but do anyway) SREG = SREG | B10000000; Turning interrupt on //Enable analog comparator interrupt ACSR = B00000010; //On failing edge (bit 1=1), AIN0 applied to positive input of the analog comparator (bit6=0) ACSR = ACSR | B00001000; // Enable analog comparator interrupt (bit 3). Turning interrupt […]