17 lines
310 B
Arduino
17 lines
310 B
Arduino
|
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;
|
||
|
}
|
||
|
}
|