Go Down

Topic: Run multiple 'functions' simultaneously in loop (Read 3270 times) previous topic - next topic


blink without delay would result in nothing, since it's looped thru in rapid speed.!?

No you do not understand it.
The blink without delay makes a note of the time now and when something needs to be done. Then the loop goes very fast seeing if it is time to do the task. If it is you do the task and set the time to do it again. It mattes not if the task is blinking an LED or stepping a motor.
If you do this with two tasks you have your two stepping motors running at the same time at speeds set interdependently.


So the led would then be lit !? Since it doesent know when to take next action?

Sorry not sitting with arduino now. Did som tests earlier today and thought i got it. Right now im trying to understand the theory of if. Thanks for all input!

You really should be playing around with the blink without delay example. Changing things and see how it affects the behavior. Only when you fully understand the concept, can you apply it to what you are trying to do.

Nick Gammon

blink without delay would result in nothing, since it's looped thru in rapid speed.!?

Look, if you are boiling an egg and frying some bacon "at the same time" that doesn't "result in nothing" because you are "looping through in rapid speed" does it?

You put the egg on. That's one thing. You put the bacon on. That's another thing. They are now cooking together. They only thing you do "rapidly" is check your watch to see if they are done.
Please post technical questions on the forum, not by personal message. Thanks!

More info:

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131