TMP102 temperature sensor test using LPC824.
Dependencies: test_TMP102 mbed
main.cpp@5:11f0da55b0fd, 2017-11-26 (annotated)
- Committer:
- yasubumi
- Date:
- Sun Nov 26 01:12:18 2017 +0000
- Revision:
- 5:11f0da55b0fd
- Parent:
- 3:600dea808e48
Make Class library for using TMP102 and add comment of usage.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yasubumi | 0:26352a9cd499 | 1 | #include "mbed.h" |
yasubumi | 2:40c813b1d6a3 | 2 | #include "test_TMP102.h" |
yasubumi | 1:3241f6a5a51e | 3 | |
yasubumi | 3:600dea808e48 | 4 | // constractor test1 |
yasubumi | 3:600dea808e48 | 5 | //test_TMP102 tmp102(dp4,dp5, 0x90); |
yasubumi | 3:600dea808e48 | 6 | |
yasubumi | 3:600dea808e48 | 7 | // constractor test2 |
yasubumi | 3:600dea808e48 | 8 | I2C i2c(dp4,dp5); |
yasubumi | 3:600dea808e48 | 9 | test_TMP102 tmp102(i2c); |
yasubumi | 0:26352a9cd499 | 10 | |
yasubumi | 2:40c813b1d6a3 | 11 | int main() |
yasubumi | 2:40c813b1d6a3 | 12 | { |
yasubumi | 3:600dea808e48 | 13 | float t; |
yasubumi | 3:600dea808e48 | 14 | |
yasubumi | 1:3241f6a5a51e | 15 | while(1) { |
yasubumi | 3:600dea808e48 | 16 | t=tmp102; |
yasubumi | 3:600dea808e48 | 17 | printf("Temp: %f\n\r", t); |
yasubumi | 0:26352a9cd499 | 18 | wait(1.0); |
yasubumi | 0:26352a9cd499 | 19 | } |
yasubumi | 0:26352a9cd499 | 20 | } |