Quick question: is it possible to define a virtual pin using #define or const so I don’t have to manually change or find and replace all instances of a vpin? I do this for I/O pins to reduce bugs and errors, as having ‘magic numbers’ in code is generally a bad idea.
I tried
#define BUTTON_PIN
and
const uint8_t BUTTON_PIN
but both of these styles made my project stop working. Is there some adjustment I can make or is this not possible with Blynk?
OK I tried again today and #define worked just fine. I think my computer was tired last night…
Both ‘1’ and ‘V1’ worked, but on your recommendation I changed to ‘V1’ style.
I see why #define works as a simple text replacement is what’s needed, rather than const int.
Thanks for clarification!