Working on a data logger application i have a small arduino device that readout some analog sensors. And over the Bluetooth it sends the measured values to my android device. It read the sensors on 50Hz so the android device receives 50 message's a second and put those values in to a text file.
On the data logger there is also an analog output that have to control something. Those values are now transmitted right after android receive a string from the Arduino. The values that i need to send are pre-recorded on a txt file. What i need is a timer that every 20ms read a line out of the text file and sput out that value over the Bluetooth. I did some experiments with the timer. But it is not reliable enough. Because every time, there is a new message from the Bluetooth the timer doesn't tick.
What will be a reliable way to execute a piece of code every 20ms?
already thanks for the help.
stef
On the data logger there is also an analog output that have to control something. Those values are now transmitted right after android receive a string from the Arduino. The values that i need to send are pre-recorded on a txt file. What i need is a timer that every 20ms read a line out of the text file and sput out that value over the Bluetooth. I did some experiments with the timer. But it is not reliable enough. Because every time, there is a new message from the Bluetooth the timer doesn't tick.
What will be a reliable way to execute a piece of code every 20ms?
already thanks for the help.
stef