Tidying up 'Several Things at the Same Time'


i've started using arduino although have quite bit of experience of 'c' across years, c# more c++ not while.

i found , tested often-quoted example doing several things @ same time , works ok found rather 'messy' - quite bit of repeated code structures. decided tidy it, while revising myself use of c++.

i have created 'task' class hides (from user of class) continuous monitoring of milliseconds. doesn't attempt use  rtos task-switching (this has been done elsewhere , works has known limitations) - uses same methodology original 'several things' in neater way (i hope!). code size a  few more bytes original. haven't run servo checked serial debug things being done @ correct times.

i'd grateful comments. i'm hoping used project needs run 2 or more tasks @ differing intervals (which appears pretty commonly on forum, seems). zip file attached.

the point of tutorial teach reader how done. there dozens of libraries try hide user. wasn't intention there. intention there educate reader on how work. while may feel have cleaned code, have lost original intention of thread.


Arduino Forum > Community > Exhibition / Gallery > Tidying up 'Several Things at the Same Time'


arduino

Comments

Popular posts from this blog

DHT11 Time out error using v0.4.1library

Sketch upload fails with Java error (___REMOVE___/bin/avrdude)!

Arduino Uno + KTY81/210 temperature sensor