17 lines
310 B
C++
17 lines
310 B
C++
int getTemperature(double &t) {
|
|
char status;
|
|
status = pressure.startTemperature();
|
|
if (status != 0)
|
|
{
|
|
// Wait for the measurement to complete:
|
|
delay(status);
|
|
status = pressure.getTemperature(t);
|
|
if (status != 0)
|
|
return 0;
|
|
else
|
|
return -1;
|
|
} else {
|
|
return -1;
|
|
}
|
|
}
|