I’m new to blynk, getting things setup and struggling to understand how virtual pins control to my physical board. I’m using Particle Argon and Particle Boron boards.
I want to send my color values out to my strips on my boards D2 pin. I see my boards in the Blynk app, added the ZeRGBa, and am not sure what to do next…
For setup with Blynk datastreams, do I want 3 virtual pins (integers) with values 0-255 for RGB? If so, how do I map that relate to my Particle boards? Or do I want to use 3 analog pins as datastreams in Blynk? Where would I specify what physical pin this is on my board? Do I need to include any LED libraries like the Neopixel one?
I’ve checked out the documentation re: virtual pins and understand the concept… I’ve looked at different code examples, but the part that is alluding me is where/how we say what the virtual pin corresponds to on the GPIO…
In that article you sent, it says:
" Pin numbering - If you’re working with an Arduino then it’s all quite simple…
However, if you’re using a NodeMCU… the numbers screen printed onto the board are not the GPIO numbers. You have to translate these NodeMCU “D” numbers onto actual GPIO’s as follows…
Lablel GPIO D1 5 D2 4
`…
So for my board, I assume I have to include a file / snipped somewhere that says V2 ='s GPIO 1 (for ex)?
I think you need to re-read my tutorial on virtual pins.
When a virtual pin value changes (say from off to on) then the corresponding BLYNK_WRITE(vPin) callback is triggered.
What you do then is entirely up to you. You can choose to write values to one or more physical ouns, or do any number of other things.
If you choose NodeMCU as your board type in the IDE then you can use either “D” references or GPIO numbers. Personally, I’d recommend sticking to GPIO numbers throughout - with a comment next to each GPIO number about what the corresponding “D” number is to help when wiring-up the hardware.
The digitalWrite commands are how you turn the digital pin on or off. You need to read the comments in the code to understand what each part of the example does.