example code to display mpl1152a data on a jhd 162a 16x2 lcd display
Dependencies: mbed mpl115a2 BME280_SPI TextLCD
Revision 4:1775558d1a45, committed 2020-04-06
- Comitter:
- skudmunky
- Date:
- Mon Apr 06 14:30:16 2020 +0000
- Parent:
- 3:99befa3962d4
- Commit message:
- dumb mistakes;
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 99befa3962d4 -r 1775558d1a45 main.cpp --- a/main.cpp Thu Apr 02 13:35:13 2020 +0000 +++ b/main.cpp Mon Apr 06 14:30:16 2020 +0000 @@ -23,8 +23,6 @@ } int main() { - - bool display_hPa = true; button.rise(&toggleDisplayFormat); @@ -38,18 +36,19 @@ if(display_hPa) { lcd.printf("MPL: %4.4f hPa\nBME: %4.4f hPa%\n", mpl_sensor.GetPressure(), - bme_sensor.getTemperature()); + bme_sensor.getPressure()); pc.printf("MPL: %4.4f hPa\nBME: %4.4f hPa%\n", mpl_sensor.GetPressure(), - bme_sensor.getTemperature()); + bme_sensor.getPressure()); } else { - lcd.printf("MPL: %4.4f cmH2O\nBME: %4.4f cmH2O%\n", + lcd.printf("MPL: %4.4f cmH2O\nBME: %4.2f cmH2O%\n", (mpl_sensor.GetPressure() * hPa2cmH2O), - (bme_sensor.getTemperature() * hPa2cmH2O)); - pc.printf("MPL: %4.4f cmH2O\nBME: %4.4f cmH2O%\n", + (bme_sensor.getPressure() * hPa2cmH2O)); + pc.printf("MPL: %4.4f cmH2O\nBME: %4.2f cmH2O%\n", (mpl_sensor.GetPressure() * hPa2cmH2O), - (bme_sensor.getTemperature() * hPa2cmH2O)); - } + (bme_sensor.getPressure() * hPa2cmH2O)); + } + wait(.1); } }