Merge pull request #943 from pimoroni/patch-bme280-examples
Fixed result status bug
This commit is contained in:
commit
b41bb4abf7
|
@ -25,7 +25,7 @@ int main() {
|
|||
|
||||
while (1) {
|
||||
BME280::bme280_reading result = bme280.read_forced();
|
||||
printf("%s %0.2lf deg C, %0.2lf hPa, %0.2lf%%\n", result.status == BME280_OK ? "OK" : "ER", result.temperature, result.pressure, result.humidity);
|
||||
printf("%s %0.2lf deg C, %0.2lf hPa, %0.2lf%%\n", result.status ? "OK" : "ER", result.temperature, result.pressure, result.humidity);
|
||||
sleep_ms(1000);
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ int main() {
|
|||
|
||||
while(true) {
|
||||
BME280::bme280_reading result = bme.read_forced();
|
||||
printf("%s %0.2lf deg C, %0.2lf hPa, %0.2lf%%\n", result.status == BME280_OK ? "OK" : "ER", result.temperature, result.pressure, result.humidity);
|
||||
printf("%s %0.2lf deg C, %0.2lf hPa, %0.2lf%%\n", result.status ? "OK" : "ER", result.temperature, result.pressure, result.humidity);
|
||||
|
||||
// calculates a colour
|
||||
float hue = HUE_START + ((float)(result.temperature - MIN) * (float)(HUE_END - HUE_START) / (float)(MAX - MIN));
|
||||
|
|
Loading…
Reference in New Issue