It is possible to do software side multi-threading on the Uno. Hardware level threading is not supported.
To achieve multithreading, it will require the implementation of a basic scheduler and maintaining a process or task list to track the different tasks that need to be run.
The structure of a very simple non-preemptive scheduler would be like:
//Pseudocode
void loop()
{
for(i=o; i<n; i++)
run(tasklist[i] for timelimit):
}
Here, tasklist can be an array of function pointers.
tasklist [] = {function1, function2, function3, ...}
With each function of the form:
int function1(long time_available)
{
top:
//Do short task
if (run_time<time_available)
goto top;
}
Each function can be doingperform a separate task such as function1 performing LED manipulations, whileand function2 doing a float calculationcalculations. It will be the responsibility of each task(function) to adhere to the time allocated to it.
Hopefully, this should be enough to get you started.