Skip to content
This repository was archived by the owner on Feb 28, 2024. It is now read-only.

Commit 10f609d

Browse files
authored
Modified Arduino MKRTHERM to support mbed
Modified ArduiniMKRTHERM to support mbed structure and added j_probe conversion factor to read J probe thermocouples
1 parent bf7be28 commit 10f609d

File tree

12 files changed

+111
-218
lines changed

12 files changed

+111
-218
lines changed

examples/Thermocouples/Thermocouples.ino

Lines changed: 0 additions & 36 deletions
This file was deleted.
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/*
2+
Automation Carrier - Thermocouples Read Sensors
3+
4+
This example reads the temperatures measured by the thermocouples
5+
connected to the Automation Carrier's temp probe inputs and prints
6+
them to the Serial Monitor once a second.
7+
8+
The circuit:
9+
- Portenta H7
10+
- Automation Carrier
11+
- Two K Type thermocouple temperature sensors connected to
12+
TEMP PROBES CH0 and CH1 on the Automation Carrier
13+
- A J Type thermocouple temperature sensor connected to
14+
TEMP PROBES CH3 on the Automation Carrier
15+
16+
17+
created 25 August 2020
18+
by Silvio Navaretti
19+
modified 28 September 2020
20+
by Riccardo Rizzo
21+
This example code is in the public domain.
22+
*/
23+
24+
#include <AutomationCarrier.h>
25+
26+
using namespace automation;
27+
28+
void setup() {
29+
Serial.begin(9600);
30+
Serial.println("Thermocouples");
31+
temp_probes.resetTH();
32+
temp_probes.tc.begin();
33+
}
34+
35+
void loop() {
36+
// Enables Thermocouples chip select
37+
// and runs Channels readings
38+
temp_probes.enableTC();
39+
40+
temp_probes.selectChannel(0);
41+
Serial.print("Reference temperature ch0: ");
42+
Serial.print(temp_probes.tc.readReferenceTemperature());
43+
Serial.println(" °C");
44+
Serial.print("Temperature ch0: ");
45+
Serial.print(temp_probes.tc.readTemperature());
46+
Serial.println(" °C");
47+
48+
temp_probes.selectChannel(1);
49+
Serial.print("Reference temperature ch1: ");
50+
Serial.print(temp_probes.tc.readReferenceTemperature());
51+
Serial.println(" °C");
52+
53+
Serial.print("Temperature ch1: ");
54+
Serial.print(temp_probes.tc.readTemperature(PROBE_J));
55+
Serial.println(" °C");
56+
57+
temp_probes.selectChannel(2);
58+
Serial.print("Reference temperature ch2: ");
59+
Serial.print(temp_probes.tc.readReferenceTemperature());
60+
Serial.println(" °C");
61+
62+
Serial.print("Temperature ch2: ");
63+
Serial.print(temp_probes.tc.readTemperature());
64+
Serial.println(" °C");
65+
66+
Serial.println();
67+
delay(1000);
68+
}

src/AutomationCarrier.h

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define __AUTOMATION_CARRIER_H__
33

44
#include "utility/Adafruit_MAX31865/Adafruit_MAX31865.h"
5-
#include "utility/Arduino_MKRTHERM/src/MKRTHERM.h"
5+
#include "utility/THERMOCOUPLE/MAX31855.h"
66
#include "utility/RS485/RS485.h"
77
#include "utility/QEI/QEI.h"
88
#include "utility/ioexpander/TCA6424A.h"
@@ -26,9 +26,17 @@ class RTDClass {
2626
ch_sel[i] = (i == channel ? 1 : 0);
2727
}
2828
}
29+
void enableTC() {
30+
cs_tc = 1;
31+
cs_rtd = 0;
32+
}
33+
void enableRTD() {
34+
cs_tc = 0;
35+
cs_rtd = 1;
36+
}
2937

30-
Adafruit_MAX31865 rtd = Adafruit_MAX31865(cs_rtd);
31-
THERMClass t = THERMClass(cs_tc);
38+
Adafruit_MAX31865 rtd = Adafruit_MAX31865(PA_6);
39+
MAX31855Class tc = MAX31855Class(PI_0);
3240

3341
private:
3442
mbed::DigitalOut ch_sel[3] = { mbed::DigitalOut(PA_0), mbed::DigitalOut(PI_4), mbed::DigitalOut(PG_10) };

src/utility/Arduino_MKRTHERM/.github/workflows/compile-examples.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/utility/Arduino_MKRTHERM/.github/workflows/spell-check.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/utility/Arduino_MKRTHERM/README.adoc

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/utility/Arduino_MKRTHERM/examples/ReadSensor/ReadSensor.ino

Lines changed: 0 additions & 43 deletions
This file was deleted.

src/utility/Arduino_MKRTHERM/keywords.txt

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/utility/Arduino_MKRTHERM/library.properties

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/utility/Arduino_MKRTHERM/src/Arduino_MKRTHERM.h

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)