arecssor
Junior Member level 1
- Joined
- Feb 21, 2015
- Messages
- 18
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 159
hi,
i tried to use interrupts in at8535 to perform a switch operation , am getting an error
my code
this is the format of the code am getting an error that ISR can't recognize the variable 'x', it shows undefined variable . i used code vision avr how can i resolve this issue
i tried to use interrupts in at8535 to perform a switch operation , am getting an error
my code
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 #include <mega8535.h> #include <alcd.h> #include <delay.h> // External Interrupt 0 service routine interrupt [EXT_INT0] void ext_int0_isr(void) { x=1; // when int0 pressed x =1 } interrupt [EXT_INT1] void ext_int1_isr(void) { x=2; } int x;// global variable declaration void main(void) { if(x=1) { lcd_putsf('int0'); } else if(x==2) { lcd_putsf('int1'); } }