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
- Committer:
- DanielBlomdahl
- Date:
- 2016-03-14
- Revision:
- 3:9339e7b93415
- Parent:
- 2:a2966bf82e8c
- Child:
- 6:76e8649a643f
File content as of revision 3:9339e7b93415:
#include "mbed.h"
#include "MAX31855.h"
#include "
Serial pc(USBTX,USBRX);
SPI spi(NC,PTD3,PTD1);
MAX31855 thermometer1(spi,PTC4);
MAX31855 thermometer2(spi,PTC3);
Timer t;
int main()
{
float temp1, temp2;
float lastTime = 0;
float dt = 0.5;
t.start();
while (1) {
if (t.read()>lastTime+dt) {
lastTime = t.read();
temp1 = thermometer1.read();
temp2 = thermometer2.read();
wait(.5);
pc.printf("%1.3f \n\r", temp1);
}
}
}
