badbu
November 8, 2017, 9:32pm
1
Hello.
I try to see an alert message when the temp gets to 50 degree.. Heres my code, can somebody help me to see whats wrong with my code?
Thanks
#include "max6675.h"
int thermoSO = 11;
int thermoCS = 12;
int thermoCLK = 13;
MAX6675 thermocouple(thermoCLK, thermoCS, thermoSO);
void setup() {
Serial.begin(9600);
delay(1000);}
void loop() {
Serial.println(thermocouple.readCelsius());
if
(MAX6675 thermocouple > 50)
Serial.println("Danger high Temp")
delay(1000);
}
You are missing both brackets and a semicolon in your if statement, and I assume your if statement should look like below.
void loop() {
Serial.println(thermocouple.readCelsius());
if (thermocouple.readCelsius() > 50)
{
Serial.println("Danger high Temp");
delay(1000);
}
}
Serial.println("Danger high Temp")
Missing final semicolon
badbu
November 8, 2017, 9:57pm
4
Wow its works thanks a lot :D. i understand now i suppose to take the (thermocouple.readCelsius) in order to make something with the information what i receive from the thermocouple. thanks a lot again.