I have two sensors, that I need to monitor constantly. the inner working of the two sensors are different and I need to check both constantly as shown below.
int sensorA(){
while (true) {
// read sensor A
cout<<"sensorA \n";
}
}
int sensorB(){
while (true) {
// read sensor B
cout<<"sensorB \n";
}
}
My question is how can I ensure the two sensors are read in interleaved manner? Like read sensorA then SensorB then Sensor A etc.