I have started an Arduino robotics project with an HC-05 Bluetooth sensor to send data to my PC for processing. In my design the Arduino is to serve as the slave which gathers data from sensors and sends it to the PC for processing and decision making, which will serve as the master.
My issue currently is that I do not know how to do multiprocessing with the Arduino. That is, I do not want the process that constantly reads data from the HC-05 bit-by-bit to block the data gathering and data transmission process. Ideally, I could have multiple threads for each process that depend on one another time-wise but not code code-execution wise and operate independently in the Arduino code.
Is there some kind of multi threading library that I can use on the Arduino side so that reading data transmitted from the PC won't block other processes/the execution of other processes will not make it so that the Arduino misses data being transmitted by the PC while it does other processing? Are there other solutions?