I´m working around a universal type of thermostat for my needs and i´m not the best code writer. After Googling
i could find and build something that i can use for the start.
The idea is that I can change the type of Thermocouple using single push button, which become default type of TC & work accordingly.
is it possible to selcet type of Thermocouple.
Please help, I would be greatful to you.
Thank you very much.
#include <Adafruit_MAX31856.h>
Adafruit_MAX31856 maxthermo = Adafruit_MAX31856(10);
void setup() {
Serial.begin(115200);
while (!Serial) delay(10);
Serial.println("MAX31856 thermocouple test");
if (!maxthermo.begin()) {
Serial.println("Could not initialize thermocouple.");
while (1) delay(10);
}
maxthermo.setThermocoupleType(MAX31856_TCTYPE_K); // Here One has to Select type of Thermocouple manually and write in Code
// How to Select Type of TC using Single Push Button,which take place of munually selected MAX31856_TCTYPE_K
Serial.print("Thermocouple type: ");
switch (maxthermo.getThermocoupleType() ) {
case MAX31856_TCTYPE_B: Serial.println("B Type"); break;
case MAX31856_TCTYPE_E: Serial.println("E Type"); break;
case MAX31856_TCTYPE_J: Serial.println("J Type"); break;
case MAX31856_TCTYPE_K: Serial.println("K Type"); break;
case MAX31856_TCTYPE_N: Serial.println("N Type"); break;
case MAX31856_TCTYPE_R: Serial.println("R Type"); break;
case MAX31856_TCTYPE_S: Serial.println("S Type"); break;
case MAX31856_TCTYPE_T: Serial.println("T Type"); break;
case MAX31856_VMODE_G8: Serial.println("Voltage x8 Gain mode"); break;
case MAX31856_VMODE_G32: Serial.println("Voltage x8 Gain mode"); break;
default: Serial.println("Unknown"); break;
}
maxthermo.setConversionMode(MAX31856_ONESHOT_NOWAIT);
}
void loop() {
// trigger a conversion, returns immediately
maxthermo.triggerOneShot();
//
// here's where you can do other things
//
delay(500); // replace this with whatever
//
//
// check for conversion complete and read temperature
if (maxthermo.conversionComplete()) {
Serial.println(maxthermo.readThermocoupleTemperature());
} else {
Serial.println("Conversion not complete!");
}
}
In start up code is already working,just write trype of TC manually. For instance Type K is selected its working perfectly.If need to connect type T then again go into code and write Type T in place of Type K.
If Push Button for Selection is available then any type of TC can be used.
do you want to monitor a switch (button) and sequence thru a set of possible types (e.g. MAX31856_TC_TYPE_B, E, J), invoking setThermocoupleType() with each newly selected type?
That requires a different user interface than what the OP asked for. However I don't see any display code so maybe only the serial port is available for control.
Aim is to select correct type of Themocouple first.By defult its Type_K.If I need to connect Type T thermocouple physically in field.I cannt use it.As by default its Type K.
Either One has to change in Code manually to Select Type T.....this same funcationality willing from push button.Next type if we need to use type R then just press button select R Type ofcourse for confirmation it will be displayed on 7 Segment display which type is selected.
on Serial Monitor it shows MAX31856_TCTYPE_K, how to show Only K instead of MAX31856_TCTYPE_K. As its not possible to display MAX31856_TCTYPE_K on 7 Segment Display
Sir,I I have tried its shows number.......like 1/2/3....
If you could do some chages to show like K/R/S/T/B/N one chacter only....would help me greatly.