Hi All,
I just have strange behaviour on my code, so just want to know if this issue is from my code or Blynk platform.
I have a piece of code in my project like below and when I press the button widget in the application repeatedly for about 5+ times the entire project goes blank and restarts (like pressing the reset button in Arduino).
// When pushed from app make it HIGH/LOW.
BLYNK_WRITE(vOnOffPin) {
relayState = param.asInt();
digitalWrite(relayPin, relayState);
// For motor status on LCD
if (relayState == HIGH) {
lcd.setCursor(16, 0);
lcd.print("ON ");
} else {
lcd.setCursor(16, 0);
lcd.print("OFF");
}
// Update Button Widget
Blynk.virtualWrite(vOnOffPin, relayState);
// For motor status fo LED widget
if (relayState == LOW) {
vLED.setColor(BLYNK_RED);
} else {
vLED.setColor(BLYNK_GREEN);
Blynk.notify("Well Motor Started");
}
}
But the same code when I comment out the following like below the reset is not happening even I press the button widget reputedly.
// When pushed from app make it HIGH/LOW.
BLYNK_WRITE(vOnOffPin) {
relayState = param.asInt();
digitalWrite(relayPin, relayState);
// For motor status on LCD
if (relayState == HIGH) {
lcd.setCursor(16, 0);
lcd.print("ON ");
} else {
lcd.setCursor(16, 0);
lcd.print("OFF");
}
// Update Button Widget
// Blynk.virtualWrite(vOnOffPin, relayState);
//
// // For motor status for LED widget
// if (relayState == LOW) {
// vLED.setColor(BLYNK_RED);
// } else {
// vLED.setColor(BLYNK_GREEN);
// Blynk.notify("Well Motor Started");
// }
}
My setup is:
- Arduino UNO with USB.
- Android Version 10
- I checked on both Blynk server and local server same issue.
- Blynk Library version 0.6.1
Please let me know if I am doing anything wrong.
Thank You So Much!!!