Hi,
I started using eHealthkit 2.4 for Arduino and I was looking through examples.
My application requires precise synchronisation of measurements with other data.
I was looking at the Pulsioximeter code Example and I stumbled upon this code:
Code:
void readPulsioximeter(){
cont ++;
if (cont == 50) { //Get only of one 50 measures to reduce the latency
eHealth.readPulsioximeter();
cont = 0;
}
}
So I was wondering whether I could get some understanding why this method is suggested. So as I understand the line:
Code:
eHealth.readPulsioximeter()
reads the values from sensors and then the lines:
Code:
float conductance = eHealth.getSkinConductance();
float resistance = eHealth.getSkinResistance();
float conductanceVol = eHealth.getSkinConductanceVoltage();
just deliver the cached (from the last measurement) data, right? So I would get the actual reading only every 50th time and every value in between would be the same as the point of measurement?
Why is that so, is it because the measurement is time-consuming? What kind of delays can I expect?
Code:
void readPulsioximeter(){
eHealth.readPulsioximeter();
}
Moreover, when looking at the implementation of the function I found that there is some delay of 300 microseconds in code:
Code:
void eHealthClass::readPulsioximeter(void)
{
uint8_t digito[41];
uint8_t A = 0;
uint8_t B = 0;
uint8_t C = 0;
uint8_t D = 0;
uint8_t E = 0;
uint8_t F = 0;
uint8_t G = 0;
for (int i = 0; i<41 ; i++) { // read all the led's of the module
A = !digitalRead(13);
B = !digitalRead(12);
C = !digitalRead(11);
D = !digitalRead(10);
E = !digitalRead(9);
F = !digitalRead(8);
G = !digitalRead(7);
digito[i] = segToNumber(A, B, C ,D ,E, F,G);
delayMicroseconds(300); //300 microseconds
}
SPO2 = 10 * digito[25] + digito[20];
BPM = 100 * digito[19] + 10 * digito[2] + digito[0];
}
What kind of delays can I expect in the measurements in general? I am mainly interested in Pulsioximeter, Temperature sensor and GSRE?