Thanks for the immediate responses. I want to use a switch case because i will eventually have to relays controlling a heating element and a cooling element. I am just in the prototyping phase right now and want to get the coding down first since this is my first experience with a k type thermocouple and the max6675 library. I was thinking use a switch case since I will eventually have two conditions while the temperature is >= 60 turn on the cooling element, while the temperature is <=57 turn on the heating element. So my initial thought was something like this:
switch(grainTemp){
case(60):
while (grainTemp>=60){
readgrainTemp;
digitalWrite(acRelay,HIGH);
}
break;
}
case(57):
while (grainTemp<=57){
readgrainTemp;
digitalWrite(heaterRelay,HIGH);
}
break;
}
I was thinking in using a switch case and while statements i could avoid clouding up the code with if and else statements. I will be building on the code later on.
i added the int grainTemp = thermocouple.readFahrenheit(); in there because I got a error code for not initializing the thermocouple.readFahrenheit as an int.