how to use multiple loops in arduino
Answers
Answer:
Split each of the first two loops at the delay()s for a total of 5 functions;
Use a timer library such as SimpleTimer to run each of the functions at the rate you need them to.
and from the only loop() function, keep calling SimpleTimer's '. run()' function to keep the whole thing going.
Explanation:
HOPE TO BE MARKED MY ANSWER AS BRILLIANT
Answer:
For the programme this would make the programming much easier to use multiple loops. They do not need to run at the same time but the switches will do different things based on the loop that's running.
Explanation:
Split each of the first two loops at the delay()s for a total of 5 functions;
Use a timer library such as SimpleTimer to run each of the functions at the rate you need them to.
and from the only loop() function, keep calling SimpleTimer's '. run()' function to keep the whole thing going.