![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Display Pressure and Temperature readings from the SCP1000 on uLCD
Dependencies: 4DGL-uLCD-SE SCP1000 mbed
Diff: main.cpp
- Revision:
- 0:24462f386127
diff -r 000000000000 -r 24462f386127 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Oct 20 00:26:24 2014 +0000 @@ -0,0 +1,26 @@ +// Hello World! for the SCP1000 + +#include "mbed.h" +#include "uLCD_4DGL.h" +#include "SCP1000.h" + +uLCD_4DGL uLCD(p28, p27, p11); // create a global lcd object +SCP1000 scp1000(p5,p6,p7,p8); + +float myTemp; +float myPressure; + +int main() { + while (true) { + uLCD.locate(0,2); + uLCD.printf("SCP1000 Demo!"); + myTemp = scp1000.readTemperature(); + myPressure = scp1000.readPressure(); + uLCD.locate(0,5); + uLCD.printf("Temp(C):\n %.3f", myTemp); + uLCD.locate(0,8); + uLCD.printf("Pressure(Pa):\n %.2f", myPressure); + wait(0.5); + } +} +