Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Interrupt

Status
Not open for further replies.

pysdex

New Member
I am using MikroC Pro compiler. I wanted to make the LED blink by pushing a button once and if I push the button the second time once the LED will stop blinking. I can make the LED blink by button push by using interrupt but I cannot make it stop by the button push. Can help me on this problem??? Thanks....
 
void interrupt()
{
portc=~portc;
delay_ms(200);
}

void main()
{
trisc=0;
trisb=0xff;
portc=0;
INTCON.GIE=1;
INTCON.PEIE=1;
INTCON.RBIE=1;
INTCON.RBIF=0;
}

I can make the LED to blink when I push the button but it won't go back to main when I press again. LED will not off when I press second time.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top