threaded code

Can I use threaded code in arduino since it's a single core?

So are you asking if you could -
Add memory, code a OS, create a “Taskmanager” type master control designed for threaded programs, and then code threaded programs to run on your Arduino.

Yes indeed you likely could.

Most users who want to load programs on a running system choose to do it on say a Raspberry as it’s already built on all that background work.

People have managed to create schedulers and multitasking but generally there is no need. Arduino programs tend to be small and simple by PC standards at least and you can manage to make it appear that the Arduino is doing several things at once using millis.

Take a look at the thread by UKHeliBob at the top of the page. It references Robin2's posts on the topic too.

We have been multi threading single core processors since the 1950’s. You do NOT need a operating system or multi cores in order to get a processor to do more than one thing at a time!

Mark

thanks everyone
but can you send me tutorials on how to write threaded code
or examples
I couldnt find any

MovieFan1995:
thanks everyone
but can you send me tutorials on how to write threaded code
or examples
I couldnt find any

Threaded ?
No, but have a look at Using millis() for timing. A beginners guide, Several things at the same time and look at the BlinkWithoutDelay example in the IDE.