This example program utilizes the MAX31856 mbed library available from Maxim Integrated at the following link: https://os.mbed.com/teams/Maxim-Integrated/code/MAX31856/
Fork of MAX31856_example_program by
Diff: main.cpp
- Revision:
- 8:8723d0006097
- Parent:
- 6:e1200ae7d6a3
- Child:
- 12:f3d87351cc34
--- a/main.cpp Mon Jul 31 18:46:49 2017 +0000 +++ b/main.cpp Tue Aug 01 03:29:15 2017 +0000 @@ -1,44 +1,42 @@ + #include "mbed.h" #include "MAX31856.h" //#include "USBSerial.h" //#include "SDFileSystem.h" -/* -//---------------------------------------------------------- -#include "max32630fthr.h" -//Define serial ports -// Hardware serial port over DAPLink -Serial daplink(P2_1, P2_0); -// Virtual serial port over USB -//USBSerial microUSB; -//---------------------------------------------------------- -//SPI Interfaces -//SPI testSPI(SPIO MOSI,SPIO MISO,SPIO SCK); -SPI testSPI(P5_1, P5_2, P5_0); -//---------------------------------------------------------- -//Define featherboard -MAX32630FTHR pegasus(MAX32630FTHR::VIO_3V3); -//---------------------------------------------------------- -//Thermocouples -MAX31856 Thermocouple(testSPI, P3_2, CR1_TC_TYPE_K, CR0_FILTER_OUT_60Hz, CR1_AVG_TC_SAMPLES_1, CR0_CONV_MODE_NORMALLY_ON); -*/ + +////---------------------------------------------------------- +//#include "max32630fthr.h" +////Define serial ports +//// Hardware serial port over DAPLink +//Serial daplink(P2_1, P2_0); +//// Virtual serial port over USB +////USBSerial microUSB; +////---------------------------------------------------------- +////SPI Interfaces +////SPI testSPI(SPIO MOSI,SPIO MISO,SPIO SCK); +//SPI testSPI(P5_1, P5_2, P5_0); +////---------------------------------------------------------- +////Define featherboard +//MAX32630FTHR pegasus(MAX32630FTHR::VIO_3V3); +////---------------------------------------------------------- +////Thermocouples +//MAX31856 Thermocouple(testSPI, P3_2, CR1_TC_TYPE_K, CR0_FILTER_OUT_60Hz, CR1_AVG_TC_SAMPLES_1, CR0_CONV_MODE_NORMALLY_ON); -//---------------------------------------------------------- -//Define serial ports + // Hardware serial port over DAPLink -Serial daplink(USBTX, USBRX); +Serial serial(USBTX, USBRX); -//SPI Interfaces -//SPI testSPI(SPIO MOSI,SPIO MISO,SPIO SCK); -SPI testSPI(P6_1, P6_2, P6_0); +//SPI spi(SPIO MOSI,SPIO MISO,SPIO SCK); +SPI spi(P6_1, P6_2, P6_0); //---------------------------------------------------------- -//------------- + //Thermocouples -MAX31856 Thermocouple(testSPI, P6_3); +MAX31856 Thermocouple(spi, P6_3); @@ -57,7 +55,7 @@ wait(0.2); temperature_TC=Thermocouple.readTC(); temperature_CJ=Thermocouple.readCJ(); - daplink.printf("MAX31856 TC = %f Celsius MAX31856 CJ = %f Celsius \n\r",temperature_TC,temperature_CJ); + serial.printf("MAX31856 TC = %f Celsius MAX31856 CJ = %f Celsius \n\r",temperature_TC,temperature_CJ); }