Try this example for using both a physical Button and a Widget button to control a GPIO pin… in this example an LED, but you can simply plug in your relay trigger pin instead.
Break it down to learn how the various Blynk commands and functions work.
i dont know how to connect or coding? im still new with this stuff… but, i really want to make my iot watering system… dht11 sensor can function well, but my waterpump cannot function…need help
OK, we are not here to be code mechanics… but this all needs medical attention stat!!
I am new to the ESP8266, but this looks wrong on a few points:
A) why not just use the IDE serial monitor to watch the debug info? NO need for SofwareSerial
B) your order and repetitive defines are wrong… Should be only these two lines and in this order…
#define BLYNK_PRINT Serial // This sends all normal Blynk feedback info to the programming UART port
#define BLYNK_DEBUG // very first line in your sketch, and only for debug purposes as it will slow everything down
.
.
.
Not critical, but these lines look lost here… move them back up before the setup void.
.
.
.
Thes void functions are just sitting there… there is no timer calls to run them, so they are doing nothing that I can see.
.
.
.
More lost little souls… move them with their brethren, up before the setup void (easier to keep track of).
.
.
.
Don’t… just don’t use delays in the voids… that is what the timers are for.