Somewhat a duplicate of what gfvalvo replied while I was writing this, but there is some extra info so I'll post it anyway:
A very useful troubleshooting tool is to do a Tools > Auto Format on your code and then look at the resulting indentation to make sure it matches your intended program structure. I see you have already done an Auto Format on your code (thanks!) so you only need to look at it. Everything looks fine until we get to the last couple lines:
}
}
}
}
This indentation (actually lack of) is a clear sign that you have more closing braces than you do opening braces. They should always be matched. So the solution is to simply remove the extra closing braces.
I also think there is a logic error in the handling of pin 10 leading to the {} mess.
I think the else statement calls for a one line execution and there is no need for an opening/closing bracket.
Or, if stylistically you always use {} to open and close a conditional execution statement even if it is a one line execution, then you need to add a }.
if (thermocouple.readFahrenheit() > val)
{
digitalWrite(10, LOW);// set pin 10 LOW
}
else
//{
digitalWrite(10, HIGH);// set pin 10 HIGH
or
if (thermocouple.readFahrenheit() > val)
{
digitalWrite(10, LOW);// set pin 10 LOW
}
else
{
digitalWrite(10, HIGH);// set pin 10 HIGH
}