Running multiple programs at once
Gary&Loren
Posts: 8
Is it possible to run multiple programs at once? If it is, how? (I have the What's a Microcontroller? Parts and Text (https://www.parallax.com/product/90005).
Comments
It seems a bit daunting at first, but the million of us who have already learned can't be wrong!
You know me, I say lets make it interesting. Who can write the smallest program to blink 5 LEDs at different rates?
I'll start a new thread to avoid hijacking this one any further. I better post quick, 'cuz I'll get slaughtered right quick by all the real programmers.
As a note I wasn't going for simplicity or compactness so much as showing an example of multi-tasking in a manner was less deterministic than a single loop updating everything at once. In my case each task is called in succession, but the time to return can vary depending on what each task does. Each task can also alter the path for the next task, so that they may not always run in sequence. This is more akin to a higher level O/S at a simpler MCU level. At the time I was trying to bang the program out while we were all hanging around my cubicle discussing it, so it's not very clean. But covers the aspects we were discussing that day.