

Every time you write something, you have to think about its impact on the whole code. So, if you decide to make a pause inside a function, then all your program is stuck waiting. A microcontroller has only one core, and is only capable of executing one instruction at a time. The “brain” of an Arduino board is a microcontroller (ATmega328 for Arduino Uno). With Arduino, things are completely different. For example when you start Firefox or Chrome, new threads will be created, so you can still execute all your programs while launching new ones.
Complex arduino libraries install#
You can install an operating system (such as Windows, Ubuntu, Debian, etc), and spawn hundreds of threads.
Complex arduino libraries how to#
You are learning how to use Arduino to build your own projects?Ĭheck out Arduino For Beginners and learn step by step.Ī classic computer has multi cores and tons of RAM. You have to understand the difference between a computer such as a laptop or web server, and an electronic board with a microcontroller (Arduino). Why multithreading is not possible on Arduino

Task 5: Print the potentiometer value via Serial every 2 seconds.Task 4: Power on LED 4 if the potentiometer value is greater than 512.Task 3: Power on LED 3 if the push button is pressed.Task 2: Read user input from Serial (number between 0 and 255) and write the data to LED 2.Why multithreading is not possible on Arduino.
