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.
main.cpp
00001 #include "mbed.h" 00002 #include "lib_MAX31856.h" 00003 00004 00005 // Hardware serial port over USB micro 00006 Serial serial(USBTX, USBRX); 00007 00008 //SPI spi(SPIO MOSI,SPIO MISO,SPIO SCK); 00009 SPI spi(PTD2, PTD3, PTD1); 00010 //---------------------------------------------------------- 00011 00012 //Thermocouples 00013 MAX31856 Thermocouple(spi, PTD0); 00014 00015 DigitalOut led1(LED1); 00016 00017 int main() { 00018 00019 00020 float temperature_TC, temperature_CJ; 00021 00022 while (true) { 00023 led1 = !led1; 00024 temperature_TC=Thermocouple.readTC(); 00025 temperature_CJ=Thermocouple.readCJ(); 00026 00027 wait(0.2); 00028 00029 serial.printf("MAX31856.CJ = %f C MAX31856.TC = %f C\n\r",temperature_CJ,temperature_TC); 00030 } 00031 }
Generated on Sat Jul 16 2022 20:46:59 by
1.7.2