Chris Styles
/
TMP102HelloWorld
This uses the published version of the library that can be imported independently
main.cpp@1:9b49379e8bf6, 2012-07-21 (annotated)
- Committer:
- chris
- Date:
- Sat Jul 21 22:41:38 2012 +0000
- Revision:
- 1:9b49379e8bf6
- Parent:
- 0:89f745be63a8
Hello world program for TMP102;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
chris | 0:89f745be63a8 | 1 | #include "mbed.h" |
chris | 0:89f745be63a8 | 2 | #include "TMP102.h" |
chris | 0:89f745be63a8 | 3 | |
chris | 0:89f745be63a8 | 4 | TMP102 temperature(p9, p10, 0x90); //A0 pin is connected to ground |
chris | 0:89f745be63a8 | 5 | |
chris | 0:89f745be63a8 | 6 | int main() |
chris | 0:89f745be63a8 | 7 | { |
chris | 1:9b49379e8bf6 | 8 | while(1) { |
chris | 1:9b49379e8bf6 | 9 | printf("Temperature: %f\n", temperature.read()); |
chris | 1:9b49379e8bf6 | 10 | wait(1.0); |
chris | 1:9b49379e8bf6 | 11 | } |
chris | 0:89f745be63a8 | 12 | } |