Upon reaching 30 degrees Celsius, a cooling fan is connected to a relay module (pin # 2), and it must be turned
Upon reaching 30 degrees Celsius, a cooling fan is connected to a relay module (pin # 2), and it must be turned on manually until the temperature (pin A0) reading reaches 25 degrees Celsius, at which point it must be automatically turned off. Complete the code in the following section to ensure that the program is correct. Assume you are able to obtain a temperature reading using the analogRead function (pin number).
Complete the code:
int highCelsius = 30;
int lowCelsius = 25;
int relaySwitch = 2;
int reading = //will be get from A0
if( ){
}
else if( ){
}
Step by step
Solved in 2 steps