Example with lib_MAX31856

Dependencies:   lib_MAX31856

Files at this revision

API Documentation at this revision

Comitter:
YSI
Date:
Fri Jul 23 08:16:54 2021 +0000
Commit message:
up lib

Changed in this revision

.gitignore Show annotated file Show diff for this revision Revisions of this file
lib_MAX31856.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-os.lib Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.gitignore	Fri Jul 23 08:16:54 2021 +0000
@@ -0,0 +1,4 @@
+.build
+.mbed
+projectfiles
+*.py*
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lib_MAX31856.lib	Fri Jul 23 08:16:54 2021 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/YSI/code/lib_MAX31856/#9fb5fcf05ac3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Jul 23 08:16:54 2021 +0000
@@ -0,0 +1,31 @@
+#include "mbed.h"
+#include "lib_MAX31856.h"
+ 
+ 
+// Hardware serial port over USB micro
+Serial serial(USBTX, USBRX);
+ 
+//SPI spi(SPIO MOSI,SPIO MISO,SPIO SCK);
+SPI spi(PTD2, PTD3, PTD1);
+//----------------------------------------------------------
+ 
+//Thermocouples
+MAX31856 Thermocouple(spi, PTD0);
+ 
+DigitalOut led1(LED1);
+ 
+int main() {
+ 
+    
+    float temperature_TC, temperature_CJ;
+    
+    while (true) {
+        led1 = !led1;
+        temperature_TC=Thermocouple.readTC();
+        temperature_CJ=Thermocouple.readCJ();
+ 
+        wait(0.2);
+ 
+        serial.printf("MAX31856.CJ = %f C   MAX31856.TC = %f C\n\r",temperature_CJ,temperature_TC);  
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-os.lib	Fri Jul 23 08:16:54 2021 +0000
@@ -0,0 +1,1 @@
+https://github.com/ARMmbed/mbed-os/#cf4f12a123c05fcae83fc56d76442015cb8a39e9