Go Down

Topic: (Resolved) Continue running one part of code while still checking other inputs? (Read 5 times) previous topic - next topic

AWOL

Quote
but I need to get multiple things to happen at once

Let us all intone the mantra:

Check the "Blink without Delay" example, without delay.

Ommmmm
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

WillR


Quote
but I need to get multiple things to happen at once

Let us all intone the mantra:

Check the "Blink without Delay" example, without delay.

Ommmmm


Ommmmm!
Just another Hacker

loudboy

Edited my post, and I'll check on the "Blink without Delay" method when I get home from work.

oommmmmmmmmmmmmm!!

TeslaFan

Blink without delay is a great start but it can get really confusing after you add in a bunch of different events. I use this simple event manager in all my stuff:

http://roboticcore.com/?p=14
Linux and Arduino, two great things that go great together!
http://www.roboticcore.com

Nick Gammon

I seem to recall there was a question recently about handling multiple interrupts in a sketch. And I also recall that Crossroads pointed out that by judicious use of diodes you can connect multiple switches to a single interrupt pin (eg, pin 2), in addition to being wired to their own unique pins.

That way, with minimal effort you first get an interrupt (as all switches are connected to the interrupt pin), and then you just check by reading the other pins which one must have changed. The diodes stop cross-talking between the switches.

Go Up