I did go back to my old code, took all but 4 out in a block comment and got them working properly. However when I implement the rest my problem of bad readings for the later sensors still persists. I have my code below as well as what the serial monitor shows.
#include "max6675.h" //include libraries (https://github.com/adafruit/MAX6675-library)
#include "SPI.h"
int thermoDO = 50; //define serial output pin
int thermoCLK = 52; //define system clock pin
int thermoCS1 = 15; //define chip select pins
int thermoCS2 =16;
int thermoCS3 = 17;
int thermoCS4 = 18;
/*
int thermoCS5 = 19;
int thermoCS6 = 20;
int thermoCS7 = 21;
int thermoCS8 = 22;
int thermoCS9 = 23;
int thermoCS10 = 24;
int thermoCS11 = 25;
int thermoCS12 = 26;
int thermoCS13 = 35;
int thermoCS14 = 36;
int thermoCS15 = 37;
int thermoCS16 = 38;
*/
MAX6675 thermocouple1(thermoCLK, thermoCS1, thermoDO); //define MAX functions
MAX6675 thermocouple2(thermoCLK, thermoCS2, thermoDO);
MAX6675 thermocouple3(thermoCLK, thermoCS3, thermoDO);
MAX6675 thermocouple4(thermoCLK, thermoCS4, thermoDO);
/*
MAX6675 thermocouple5(thermoCLK, thermoCS5, thermoDO);
MAX6675 thermocouple6(thermoCLK, thermoCS6, thermoDO);
MAX6675 thermocouple7(thermoCLK, thermoCS7, thermoDO);
MAX6675 thermocouple8(thermoCLK, thermoCS8, thermoDO);
MAX6675 thermocouple9(thermoCLK, thermoCS9, thermoDO);
MAX6675 thermocouple10(thermoCLK, thermoCS10, thermoDO);
MAX6675 thermocouple11(thermoCLK, thermoCS11, thermoDO);
MAX6675 thermocouple12(thermoCLK, thermoCS12, thermoDO);
MAX6675 thermocouple13(thermoCLK, thermoCS13, thermoDO);
MAX6675 thermocouple14(thermoCLK, thermoCS14, thermoDO);
MAX6675 thermocouple15(thermoCLK, thermoCS15, thermoDO);
MAX6675 thermocouple16(thermoCLK, thermoCS16, thermoDO);
*/
int i = 1; //set data counter start point
unsigned long time; //define time as a long variable
float thermoReading;
void setup() {
Serial.begin(9600); //set data rate
delay(10000); //initial delay
}
void loop() {
Serial.print("Data Set #"); //print data set label
Serial.println(i); //print data set numer
time = millis()/1000; //take time reading
Serial.print("sensor 1,"); //print sensor label
Serial.print(time); //print time
Serial.print(","); //print comma
thermoReading = thermocouple1.readCelsius(); //take thermocouple reading
Serial.println(thermoReading); //print thermocouple reading
delay(100); //delay between readings
time = millis()/1000;
Serial.print("sensor 2,");
Serial.print(time);
Serial.print(",");
thermoReading = thermocouple2.readCelsius();
Serial.println(thermoReading);
delay(100);
time = millis()/1000;
Serial.print("sensor 3,");
Serial.print(time);
Serial.print(",");
thermoReading = thermocouple3.readCelsius();
Serial.println(thermoReading);
delay(100);
time = millis()/1000;
Serial.print("sensor 4,");
Serial.print(time);
Serial.print(",");
thermoReading = thermocouple4.readCelsius();
Serial.println(thermoReading);
delay(100);
/*
time = millis()/1000;
Serial.print("sensor 5,");
Serial.print(time);
Serial.print(",");
thermoReading = thermocouple5.readCelsius();
Serial.println(thermoReading);
delay(100);
time = millis()/1000;
Serial.print("sensor 6,");
Serial.print(time);
Serial.print(",");
thermoReading = thermocouple6.readCelsius();
Serial.println(thermoReading);
delay(100);
time = millis()/1000;
Serial.print("sensor 7,");
Serial.print(time);
Serial.print(",");
thermoReading = thermocouple7.readCelsius();
Serial.println(thermoReading);
delay(100);
time = millis()/1000;
Serial.print("sensor 8,");
Serial.print(time);
Serial.print(",");
thermoReading = thermocouple8.readCelsius();
Serial.println(thermoReading);
delay(100);
time = millis()/1000;
Serial.print("sensor 9,");
Serial.print(time);
Serial.print(",");
thermoReading = thermocouple9.readCelsius();
Serial.println(thermoReading);
delay(100);
time = millis()/1000;
Serial.print("sensor 10,");
Serial.print(time);
Serial.print(",");
thermoReading = thermocouple10.readCelsius();
Serial.println(thermoReading);
delay(100);
time = millis()/1000;
Serial.print("sensor 11,");
Serial.print(time);
Serial.print(",");
thermoReading = thermocouple11.readCelsius();
Serial.println(thermoReading);
delay(100);
time = millis()/1000;
Serial.print("sensor 12,");
Serial.print(time);
Serial.print(",");
thermoReading = thermocouple12.readCelsius();
Serial.println(thermoReading);
delay(50);
time = millis()/1000;
Serial.print("sensor 13,");
Serial.print(time);
Serial.print(",");
thermoReading = thermocouple13.readCelsius();
Serial.println(thermoReading);
delay(50);
time = millis()/1000;
Serial.print("sensor 14,");
Serial.print(time);
Serial.print(",");
thermoReading = thermocouple14.readCelsius();
Serial.println(thermoReading);
delay(50);
time = millis()/1000;
Serial.print("sensor 15,");
Serial.print(time);
Serial.print(",");
thermoReading = thermocouple15.readCelsius();
Serial.println(thermoReading);
delay(50);
time = millis()/1000;
Serial.print("sensor 16,");
Serial.print(time);
Serial.print(",");
thermoReading = thermocouple16.readCelsius();
Serial.println(thermoReading);
*/
i += 1; //adding to data set counter (add 1)
delay(10000); //set time delay between set readings
}
Serial monitor with only 4
Data Set #1
sensor 1,9,24.75
sensor 2,10,24.50
sensor 3,10,24.75
sensor 4,10,23.75
Data Set #2
sensor 1,20,24.75
sensor 2,20,24.25
sensor 3,20,25.00
sensor 4,20,23.75
Serial monitor with 16
Data Set #3
sensor 1,33,25.25
sensor 2,33,24.25
sensor 3,33,25.25
sensor 4,34,24.50
sensor 5,34,25.50
sensor 6,34,24.50
sensor 7,34,25.75
sensor 8,34,16.00
sensor 9,34,15.00
sensor 10,34,16.00
sensor 11,35,16.00
sensor 12,35,14.00
sensor 13,35,16.00
sensor 14,35,15.00
sensor 15,35,16.00
sensor 16,35,15.00