August 05, 2013

Handling multiple tasks in Arduino sketches

As much as we'd like doing so to be possible, an Arduino cannot truly multi-task and run several functions at the same time. However there are some ways to get around this limitation, and an interesting lesson on the topic has been published for the public by Stanford University in the US. This covers the concept of handling multiple tasks in a sketch, and several examples have bee provided and documented. By eliminating the use of the delay() function and instead timing periods using the millis() and micros() functions, it's possible to run two or more tasks at once. Finally this has been demonstrated including the sketch and notes.

 

It's a great way to learn how to stop relying on time-block execution of tasks, so visit the tutorial page to learn the methods. And for more, we're on twitter and Google+, so follow us for news and product updates as well.

If you're new to Arduino and want to join the fun, the first step is a solid board for your projects - our Freetronics Eleven - the Arduino-Uno compatible with low-profile USB socket, onboard prototyping space and easy to view LEDs:

 

Leave a comment

Comments have to be approved before showing up.