But all you are doing is sending a 1 to the ESP upon MEGA button press… so why wouldn’t it work (aside from all the button bounce potential, etc… but that is a whole other issue)
Besides a bool can only respond with a 0 or 1 (true or false) so not any different then the basic if(param.asInt)
Well… to be honest, I haven’t been following all of your topic, so I am unsure exactly what you are doing. But at a glance…
If you have a list of choices you want to pick from on the ESP, but you want them to be chosen from the Mega… then first you have to have a good way to do multiple choice from the Mega… a single button can only do one proper choice when pressed.
But if you can send, for example a number between 1 and 3, then the receiver can use switch case to respond acordingly.
my topic is only send digital signal from atmega to Nodemcu which will change the Menu widget property and also in the future i can
Do reverse like send signal from the Blynk and it can turn On/Off in Atmega 2560.
only this simple thing but problem is Menu widget is not changes its labels when i press Run button. I have to choose the menu widget {[item0] , [Item1]}
when item0 is choose it will change to Menu 1 , menu 2 , menu 3
but i don’t won’t this working like, as i mentioned above my procedure.
Well… I’m trying your switch case procedure than get back to you on this.
Sorry, I am not following exactly what you are trying to do with the Mega’s digital input in a way that it can change the ESPs menu option.
I thought you were using the Mega becasue it had lots of I/O (presumably for output control of lighting) and using Easy therasnfer to do so.
Now you are using Blynk on both and using Blynk’s bridge… but if you are using Blynk on the Mega… then what do you need the NodeMCU for? Just add in an ESP-01 (in AT mode as a WiFi to serial transceiver) to the Mega and use it by itself with Blynk.
Well, then you cannot use Blynk (and thus Blynk’s bridge) for the Mega as it cannot connect to the server and I don’t think you can even get a NodeMCU to act as a AT mode Serial to WiFi transceiver… so it is back to using Easy Transfer for you.
If all you’re trying to do is detect with your Arduino if a pin on the NodeMCU is high, then why not just connect the NodeMCU pin dircctly to your Arduino and monitor the logic level of the pin that it’s connected to?
The NodeMCU will give 3.3v outut to the pin whne it’s HIGH, which will almost certainly b treated as a HIGH signal by the Arduino.
If you want to do the opposite, then you’ll need a resistor to drop the voltage from 5v to 3.3
In either case, the GND pins of both devices will need to be shared.