Hi all this is my first time posting. I'm trying to get a arduino to control a heating element based off of inputs given by a thermocouple which will hopefully also be displayed on a little lcd screen. Currently I have a code from the adafruit_max31855.h breakout board which displays the temp like I would like however some of the pins (4, 5, 6, 7) are used to control the the relays on the seeed relay shield and the program uses (3,4,5) for the thermocouple and (7, 8, 9, 10, 11, 12) is used for the LCD display. How would I go about moving the thermocouple pins to (1, 2, 3) and move the lcd pin to (8, 9, 10, 11, 12, 13) . I've tried to simply shift the numbers to the range as described above however the temp isn't changing on the lcd display and it isn't reading the int. temp as it was before adding the shield. Allow me to say thanks in advance and I really appreciate any help in this matter.
Code as given by adafruit libary for max31855
#include <SPI.h>
#include "Adafruit_MAX31855.h"
#include <LiquidCrystal.h>
int thermoCLK = 3;
int thermoCS = 4;
int thermoDO = 5;
// Initialize the Thermocouple
Adafruit_MAX31855 thermocouple(thermoCLK, thermoCS, thermoDO);
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
void setup() {
Serial.begin(9600);
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
lcd.print("MAX31855 test");
// wait for MAX chip to stabilize
delay(500);
}
void loop() {
// basic readout test, just print the current temp
lcd.setCursor(0, 0);
lcd.print("Int. Temp = ");
lcd.println(thermocouple.readInternal());
lcd.print(" ");
double c = thermocouple.readCelsius();
lcd.setCursor(0, 1);
if (isnan(c))
{
lcd.print("T/C Problem");
}
else
{
lcd.print("C = ");
lcd.print(c);
lcd.print(" ");
}
delay(1000);
}
code with shifted pin location to accommodate relay board.
#include <SPI.h>
#include "Adafruit_MAX31855.h"
#include <LiquidCrystal.h>
int thermoCLK = 0;
int thermoCS = 1;
int thermoDO = 2;
// Initialize the Thermocouple
Adafruit_MAX31855 thermocouple(thermoCLK, thermoCS, thermoDO);
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(8, 9, 10, 11, 12, 13);