Threads are different processes that a device runs at once. Unless it has multiple cores, it has to switch between the threads to ensure that all the threads get ran.
Questions tagged [threads]
30 questions
83
votes
9 answers
How can I create multiple running threads?
Is there a way I can have multiple parts of the program running together without doing multiple things in the same code block?
One thread waiting for an external device while also blinking a LED in another thread.
Bja
- 953
- 1
- 8
- 8
9
votes
3 answers
Multiple independent LED patterns
I have an problem, which at first thoughts (and being new to Arduino) I though was a perfect application for an Arduino. However, after trying and failing to implement it I am doubting myself!
Simply - I need to control many LEDs independently, many…
Nickos
- 93
- 1
- 3
8
votes
1 answer
Event driven programming
I have ran across a couple of different event libraries that are available on the AVR and Andruino but I am not sure which one is the best option. What I would like to do is design my program in a event driven style but not sure how to go about…
Andy Braham
- 468
- 1
- 8
- 17
5
votes
2 answers
What’s the most common (and low cost) microprocessor with at least two threads?
I want to make a next version of my current project. I’m hoping to use an Arduino compatible processor that also supports at least 2 processes simultaneously without using pro threading or any other software workaround. The more commonly used the…
Delaney Fitzpatrick
- 129
- 1
3
votes
2 answers
Is it bad practice to multitask without timing constraints
Going through resources such as several things at the same time and with some greatly appreciated assistance on here I'm finally getting a grasp on how to multitask a microcontroller.
Most examples use the millis() approach to nonblocking…
Zhelyazko Grudov
- 367
- 2
- 15
2
votes
2 answers
arduino acclerometer with servo motor
I'm currently working on project to operate three motors while sending accelerometer value to computer via bluetooth module. I want the motor operation and value transmission to work seperatly. But when motors operate, the transmission stops. I used…
John Cho
- 41
- 6
2
votes
2 answers
ESP32: How to run two independent PID controllers, one per core?
I want to control 2 independent processes with 2 PID controllers. Is it possible to run each controller on a separate core? I'm using this PID library. According to its documentation, the PID::Compute() function should be called once every loop().…
glamis
- 61
- 1
- 7
2
votes
2 answers
How can i do something like multi threathing in arduino?
I am checking for ways to implement multi threathing in Arduino, I have also tried using the library TimerOne but it doesn't seem to work, what I'm trying to make is an Arduino application then, every time a certain amount of time passes, it pops an…
user57129
- 121
- 1
2
votes
0 answers
Receiving and transmitting messages simultaneously
tldr; I am writing a mesh network software using arduinos. I need to wirelessly receive, process, and transmit data, all simultaneously. I am aware of protothreads library, and the other software solutions, such as using interrupts, however, I am…
Jonathan
- 264
- 3
- 15
1
vote
0 answers
Problem when running Servo library with thread (Protothreads)
When running two threads, one for blinking led once every second, one for sweeping the servo 180 degrees. The servo just vibrates.
When I tested adding a serial printout in the run servo for loops for the pos variable it worked but a bit jerky. Any…
jst_swe
- 11
- 1
1
vote
2 answers
How can I use both ultrasonic and IR sensor and ultrasonic sensor at ones with Arduino
I want to use both the ultrasonic sensor and IR sensor with Arduino + motors for a car project. Will I have to do any kind of multithreading on Arduino, or is it something else
Amit Nikhade
- 59
- 7
1
vote
1 answer
Is my sketch 'thread safe'?
I come from a .Net background, typically I would 'lock' operations on an integer when I have thread-safe requirements. I'm not sure that applies to my sketch here? Could I potentially bypass an increment from one of my interrupt pins?
In summary, I…
JᴀʏMᴇᴇ
- 35
- 7
1
vote
0 answers
Bluetooth multithreading
I'm using my Arduino to make a speaker-like device. Instead of sound, it receives the beat of the song, thus the data comes in an array of floats. Each item in the array is a timestamp, an LED is turned on based on that value.
For example,…
yeahyongying
- 11
- 1
1
vote
0 answers
FreeRTOS single thread vs Function call
Good day to everyone,
I am currently working on project using ATmega2560. I want to use threading, that is why I decided to use FreeRTOS. However, I cannot make one thread to work fine, so that I start writing second one. So, I have following…
Miradil Zeynalli
- 123
- 7
1
vote
1 answer
Can we call GPRS HTTP request asynchronously in Arduino?
Usually GPRS modules (SIM800,900, A6, etc) that used with arduino are called in synchronous way in HTTP (GET/POST) request. It takes more than 10 seconds in most times and this makes the system very slow. Is there a way to use them (libraries or the…
Salitha Indrajith Pathiraja
- 283
- 1
- 2
- 5