Answers for "enable interrupt avr"

C++
0

enable interrupt avr

#include<avr/io.h>
#include<avr/interrupt.h>

ISR (INT0_vect)
{
	code1;			//Add your code
}
ISR (INT1_vect)
{
	code2;			//Add your code
}

int main
{
GICR=0xc0;   //Enable External Interrupts INT0 and INT1
	MCUCR=0x08;  //Configure INT0 active low level triggered and INT1 as falling edge
	
	sei();     // Enable global interrupts by setting global interrupt enable bit in SREG
}
Posted by: Guest on January-08-2021

Browse Popular Code Answers by Language