To use the node in your project you should have the greenberg-nicholas/esp32-relay library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.
C++ implementation
struct State {
char color[10];
};
{{ GENERATED_CODE }}
void evaluate(Context ctx) {
auto state = getState(ctx);
auto blynk = getValue<input_BLNK>(ctx);
uint8_t vpin = getValue<input_VPIN>(ctx);
if (isInputDirty<input_INIT>(ctx)){
uint8_t vpin = getValue<input_VPIN>(ctx);
blynk.xodBlynk->virtualWrite(vpin, 255);
}
if (isInputDirty<input_PUSH>(ctx)){
dump(getValue<input_CLR>(ctx),state->color);
blynk.xodBlynk->setProperty(vpin,"color",state->color);
}
}