Grove Temp sensor Hello world example
Dependencies: Grove_temp_sensor mbed
Diff: main.cpp
- Revision:
- 3:056a7a65f807
- Parent:
- 1:e3c235c7edaf
diff -r 772a59579086 -r 056a7a65f807 main.cpp --- a/main.cpp Thu Mar 10 19:08:46 2016 +0000 +++ b/main.cpp Thu Mar 10 19:42:29 2016 +0000 @@ -1,11 +1,16 @@ #include "mbed.h" #include "Grove_temp_sensor.h" +// This is the hello world example how to use this sensor + +//creat sensor object Grove_temp_sensor input(p15); +//set up usb serial port Serial pc(USBTX, USBRX); int main() { double temp; while(1) { - temp = input.read(); + //read the temperature here + temp = input.read_F(); printf("The temperature is: %5.2F F \n\r", temp); wait(0.5); }