on/off only
This commit is contained in:
@ -83,8 +83,11 @@ void callback(char* topic, byte* payload, unsigned int length) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (! strcmp(topic, configBlock.mqttTopic)) {
|
if (! strcmp(topic, configBlock.mqttTopic)) {
|
||||||
int value = atoi(buffer);
|
if (! strcmp(buffer, "ON")) {
|
||||||
analogWrite(LIGHT_PIN, value);
|
digitalWrite(LIGHT_PIN, HIGH);
|
||||||
|
} else {
|
||||||
|
digitalWrite(LIGHT_PIN, LOW);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user