Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: MAX31855 SDFileSystem mbed
main.cpp@3:9339e7b93415, 2016-03-14 (annotated)
- Committer:
- DanielBlomdahl
- Date:
- Mon Mar 14 20:41:22 2016 +0000
- Revision:
- 3:9339e7b93415
- Parent:
- 2:a2966bf82e8c
- Child:
- 6:76e8649a643f
This is the March 14th update
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| DanielBlomdahl | 2:a2966bf82e8c | 1 | |
| DanielBlomdahl | 0:42e8fa13c7a9 | 2 | #include "mbed.h" |
| DanielBlomdahl | 2:a2966bf82e8c | 3 | #include "MAX31855.h" |
| DanielBlomdahl | 3:9339e7b93415 | 4 | #include " |
| DanielBlomdahl | 0:42e8fa13c7a9 | 5 | |
| DanielBlomdahl | 2:a2966bf82e8c | 6 | Serial pc(USBTX,USBRX); |
| DanielBlomdahl | 2:a2966bf82e8c | 7 | SPI spi(NC,PTD3,PTD1); |
| DanielBlomdahl | 2:a2966bf82e8c | 8 | |
| DanielBlomdahl | 2:a2966bf82e8c | 9 | MAX31855 thermometer1(spi,PTC4); |
| DanielBlomdahl | 2:a2966bf82e8c | 10 | MAX31855 thermometer2(spi,PTC3); |
| DanielBlomdahl | 1:8116bd9d3c46 | 11 | Timer t; |
| DanielBlomdahl | 0:42e8fa13c7a9 | 12 | |
| DanielBlomdahl | 0:42e8fa13c7a9 | 13 | int main() |
| DanielBlomdahl | 0:42e8fa13c7a9 | 14 | { |
| DanielBlomdahl | 1:8116bd9d3c46 | 15 | float temp1, temp2; |
| DanielBlomdahl | 1:8116bd9d3c46 | 16 | float lastTime = 0; |
| DanielBlomdahl | 1:8116bd9d3c46 | 17 | float dt = 0.5; |
| DanielBlomdahl | 1:8116bd9d3c46 | 18 | t.start(); |
| DanielBlomdahl | 1:8116bd9d3c46 | 19 | |
| DanielBlomdahl | 1:8116bd9d3c46 | 20 | while (1) { |
| DanielBlomdahl | 2:a2966bf82e8c | 21 | if (t.read()>lastTime+dt) { |
| DanielBlomdahl | 2:a2966bf82e8c | 22 | lastTime = t.read(); |
| DanielBlomdahl | 1:8116bd9d3c46 | 23 | temp1 = thermometer1.read(); |
| DanielBlomdahl | 1:8116bd9d3c46 | 24 | temp2 = thermometer2.read(); |
| DanielBlomdahl | 2:a2966bf82e8c | 25 | wait(.5); |
| DanielBlomdahl | 2:a2966bf82e8c | 26 | pc.printf("%1.3f \n\r", temp1); |
| DanielBlomdahl | 2:a2966bf82e8c | 27 | } |
| DanielBlomdahl | 2:a2966bf82e8c | 28 | } |
| DanielBlomdahl | 0:42e8fa13c7a9 | 29 | } |
