Multiple conditions in an if statement (fixed)

Thank you for the help! var relay1; if (cTemp >= fHigh) { // ...italics this is if the current temp is greater that or equal to the fHigh variable (in this case 3 degrees), then turn on relay 1 and cool down the freezer.

the next line if (cTemp >= fLow && relay1 === 0 ) { var relay1 = 0} italics I would like it to check the state of relay 1 and the current temp (cTemp). If the relay is on and its between fLow and fHigh it means the freezer is cooling down to the low temperature (fLow). If its off it should stay off until in gets to fHigh, because its warming up because the compressor is off.

Please let me know if this makes sense.

/r/javascript Thread Parent