Questions tagged [threads]

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.

Filter by
Sorted by
Tagged with
6
votes
2answers
276 views

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 ...
1
vote
1answer
42 views

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
2
votes
2answers
239 views

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(...
0
votes
0answers
182 views

Can the Arduino Pro (Portenta H7) communicate between threads?

I have an application that runs a stepper motor from an Arduino board. This requires use of the delayMicroseconds(int us) to control the speed at which the motor turns. For this reason, all code ...
0
votes
1answer
63 views

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 ...
0
votes
0answers
44 views

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 ...
0
votes
0answers
32 views

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 ...
0
votes
1answer
148 views

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 ...
0
votes
0answers
42 views

Capacitive Sensor and Thread

Looking for a great way to detect when someone touches thread, or if 4 people touch thread etc. I'm not looking for a hand count, but I'm going to try to translate it into MIDI for use in a project. ...
1
vote
1answer
385 views

Protothread Library Stalling on One Thread

I am trying to use a protothreading library found here http://harteware.blogspot.com/2010/11/protothread-powerfull-library.html to perform protothreading with my Arduino so I can "simultaneously" ...
2
votes
2answers
190 views

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 ...
0
votes
1answer
650 views

Lighting LED Strip via HC-06 Bluetooth Module

What I Am Working With: I am working on a project involving an Arduino, some RGB led strip, and my PC. My Project: The PC sends UART (serial) data to the Arduino over Bluetooth (through a HC-06 ...
1
vote
1answer
1k views

Is this a proper implementation of FreeRTOS for Arduino?

I'm using the RGBLCDShield library and a few analog input signals and since it seems the interrupts are being used by the SPI interface of the LCD Shield, I decided to try it with FreeRTOS instead. I ...
1
vote
0answers
188 views

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 ...
1
vote
1answer
134 views

mthread and multiple header files

I'm using mthreads (https://github.com/jlamothe/mthread) for my arduino. But now as the project is getting bigger, it would make sense to break it up in several files. I successfully outsourced ...
8
votes
1answer
3k views

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 ...
0
votes
1answer
638 views

Is it possible to accept multiple web requests at once?

I have an Arduino with ethernet shield and there are 8 different URLs that can be called to perform different actions. The program loads and runs as expected for the most part, but, if it is busy ...
1
vote
2answers
474 views

Existence of a non blocking and task yield framework for Arduino programming

I've been playing around with Arduino and understand that the standard runtime provides a single thread essentially. I was wondering if it is possible to write a thin layer (library) that allows one ...
1
vote
5answers
569 views

Multi-threaded Robot

I am working on a small robot project, the code which i made for this has a sequential execution in a single thread. There are a lot of Delay() function needed. Due to which the accuracy is extremely ...
0
votes
1answer
130 views

Embedded-c, schedule a function?

Simple question, of course if you do this FunctionA(); Delay(1000); FunctionB(); FunctionC(); it will call A, then wait a second, then call B, then call C. How does one do this? ... FunctionA(); ....
0
votes
2answers
4k views

Arduino Protothreads by Example

I am trying to get Arduino working with Protothreads and wanted to confirm I have the basic setup correct. If I have understood the API correctly, then the following code should be what I need to ...
0
votes
2answers
288 views

Multithreading Leds and Joystick

I'm trying to made a program that turn on and turn off leds with an input and send the coordinates of joystick, but, in the loop, the arduino makes one at a time, and i want make this in the same time....
1
vote
1answer
221 views

How to avoid the code interrupting itself?

I have this code, which I am using with a potentiometer to control the speed of a automotive fuel injector. In it, I have specified how long the injector shall stay open by using the delay functions. ...
0
votes
1answer
147 views

Paralellizing sensor data input [closed]

I have a total of 15 sensors (analog and digital) connected to an arduino mega. For my real-time control application, it's really really important that all data be collected simultaneously at regular ...
8
votes
3answers
6k views

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 ...
68
votes
9answers
139k views

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 ...