#include #include #include #include const int thermoDO = 12; const int thermoCS = 2; const int thermoCLK = 13; MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO); File eventList; // FILE pointer for eventLst file DS3231 rtc(SDA, SCL); // Define rtc const int Red=3; const int Green=5; const int Blue=6; byte nextEventFlag[13]; // array to hold the pointer to the next event on the list aiming to impliment multiple events for all channels byte activeEventPointer[13]; // ppinters to show which of the 2 d array is active for any channel float intensity[13]; // array that holds the calculated intensity for each channel float output; // variable used to calculate the normalisation setting for the overall output once scaled to each channels individual intensity setting long refTime[13]; // array to hold a list of event start times long duration[13]; // array to hold the duration of each event float maxIntensity[13]; // array to hold a list of maximum intensities const char* filename = {"eventlis.csv"}; // file to hold list of events long startTime; int i; int flag = 1; const float pi = 3.14159; void setup() { Serial.begin(9600); Serial.println("MAX6675 Initialise"); delay(500); digitalWrite(thermoCS,LOW); // forcing CS for 6675 low although looking at MAX6675.cpp, it looks as if this is not needed Serial.print("C = "); Serial.println(thermocouple.readCelsius()); digitalWrite(thermoCS,HIGH); // forcing CS for 6675 HIGH although looking at MAX6675.cpp, it looks as if this is not needed delay(2000); pinMode(Red, OUTPUT); pinMode(Green, OUTPUT); pinMode(Blue, OUTPUT); rtc.begin(); // start real time clock stream if (!SD.begin(10)) { Serial.println("initialization failed!"); } digitalWrite(10,HIGH); // trying to force the sd card to release the SPI bus but making its CS pin high digitalWrite(thermoCS,LOW); Serial.print("again C = "); Serial.println(thermocouple.readCelsius()); digitalWrite(thermoCS,HIGH); delay(500);