|
|
@ -23,17 +23,17 @@ void message_callback(const String &message) |
|
|
|
{ |
|
|
|
Serial.println(message); |
|
|
|
if (message == "off") { |
|
|
|
digitalWrite(heating_pin, LOW); |
|
|
|
digitalWrite(heating_pin, HIGH); |
|
|
|
} |
|
|
|
if (message == "on") { |
|
|
|
digitalWrite(heating_pin, HIGH); |
|
|
|
digitalWrite(heating_pin, LOW); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void setup() |
|
|
|
{ |
|
|
|
pinMode(heating_pin, OUTPUT); // Initialize the LED_BUILTIN pin as an output
|
|
|
|
digitalWrite(heating_pin, LOW); // Turn the LED on (Note that LOW is the voltage level
|
|
|
|
pinMode(heating_pin, OUTPUT); |
|
|
|
digitalWrite(heating_pin, HIGH); // by default output the voltage that switches off the heater
|
|
|
|
|
|
|
|
Serial.begin(115200); |
|
|
|
|
|
|
|