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.

I need help using Interrupt routines

Status
Not open for further replies.

KaRyu

New Member
There is 1 led display, 3 switches
This should be the flow of the program:
the default led display is 0;
when sw1 is pressed, the led display will count up(1,2,3,4,5,6,7,8,9);
when sw2 is pressed, the led display will count down(9,8,7,6,5,4,3,2,1);
when sw3 is pressed, the led display will count odd numbers(1,3,5,7,9);

Whiile counting up when sw2 is pressed, the led display will count down then return to where it was interrupted
Whiile counting up when sw3 is pressed, the led display will just continue to count up.

Whiile counting down when sw3 is pressed, the led display will count odd numbers then return to where it was interrupted
Whiile counting down when sw1 is pressed, the led display will just continue to count up.



Whiile counting odd numbers when sw1 is pressed, the led display will count up then return to where it was interrupted
Whiile counting odd numbers when sw3 is pressed, the led display will just continue to count up.
 
Which processor are you using? Why do you think that needs an interrupt? What language are you using?

John
 
Status
Not open for further replies.

Latest threads

Back
Top