I am using the WROOM 32S or NodeMCU32S board selection and have setup my relays to the GPIO pins and have them setup in Arduino. The code compiles fine and my relays are setup on the following:
const int Relay1 = 2;
const int Relay2 = 15;
const int Relay3 = 5;
const int Relay4 = 4;
Blynk allows me to drop down and select 2, 4, and 5 but 15 does not exist. Where do I change this? It goes to 13 but no 15 to be found. Any help would be great!
In the legacy version of Blynk, you selected a board type and this gave you a list of digital pins that related to that board.
When Blynk IoT was released, no digital pins were available at all. Later, they did add digital pins, but this was done in a very strange way, and there is no relationship between the pins available on the board and those available in Blynk.
I raised this issue a few years ago, but it seems it still remains.
But, the good news is that you can forget using digital datastreams. I never used them in the Legacy version of Blynk, and I don’t really know why they were re-introduced in Blynk IoT, because they aren’t needed.
Instead, you should use virtual datastreams, and add a simple virtual pin handler function into your code for each virtual datastream you use.
This guide was written for the legacy version of Blynk, but the basic principals and the code examples apply equal well to Blynk IoT
There’s also a good description of how to use virtual datastreams in the Blynk IoT documentation…
Thanks! I did go ahead and use virtual pins and all is working fine. I have another question on how to control the DAC via virtual pins now and will do a bit of searching now this is out of the way.
Thanks Pete! My DAC is working, but I now have issues synchronizing the board and server after reset. I have added code to turn on all 4 relays, and after a power cycle, it remembers the state of the all-on (v5), but individual widgets are a bit wonky. Still learning so digging in to see what I am doing wrong. I appreciate all the support and pointing me to the right docs