Grove Temp sensor Hello world example
Dependencies: Grove_temp_sensor mbed
main.cpp@1:e3c235c7edaf, 2016-03-09 (annotated)
- Committer:
- peipei123
- Date:
- Wed Mar 09 22:14:38 2016 +0000
- Revision:
- 1:e3c235c7edaf
- Parent:
- 0:3fa32ef93fdc
- Child:
- 3:056a7a65f807
Change code
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| peipei123 | 0:3fa32ef93fdc | 1 | #include "mbed.h" |
| peipei123 | 0:3fa32ef93fdc | 2 | #include "Grove_temp_sensor.h" |
| peipei123 | 1:e3c235c7edaf | 3 | Grove_temp_sensor input(p15); |
| peipei123 | 1:e3c235c7edaf | 4 | Serial pc(USBTX, USBRX); |
| peipei123 | 0:3fa32ef93fdc | 5 | int main() { |
| peipei123 | 0:3fa32ef93fdc | 6 | double temp; |
| peipei123 | 0:3fa32ef93fdc | 7 | while(1) { |
| peipei123 | 1:e3c235c7edaf | 8 | temp = input.read(); |
| peipei123 | 1:e3c235c7edaf | 9 | printf("The temperature is: %5.2F F \n\r", temp); |
| peipei123 | 1:e3c235c7edaf | 10 | wait(0.5); |
| peipei123 | 0:3fa32ef93fdc | 11 | } |
| peipei123 | 0:3fa32ef93fdc | 12 | } |
Grove Temperature Sensor