Is that right? I hadn’t realised that fundamental piece of information as I relied too much on copy and paste from another script rather than learning how the code functions.
Some variables are only required locally so it would be a waste of memory to declare them globally. For a small project like yours you shouldn’t have any issues with memory so you could have them all globally but it’s best if you consider the purpose of each variable and that will determine if it needs to be global or not.
There’s my problem. I set the auth token up as arduino uno / esp8266 combo in the template thingy… But I noticed in the blynk app that I have it listed as a esp8266 only.
I didn’t think it would be a problem for virtual pins, and as I don’t use the digital pins in the app, so I didn’t bother changing it…
I’ll be sure to set the correct boards for this arduino/esp826 combo from now on and change that correctly.
That’s ok. I’m only using something like 10 vpins, just I had them spaced out in their functions so 40’s were distribution amounts etc.
I’ve moved them all below 31 and everything works fine. Such a small thing that wasted so much time. I notice where the problem lied as I sent the vpin value back to the Blynk app when I changed the slider and noticed that pin didn’t return a change but the lower number vpins did.
I realised that the board wasn’t set right in Blynk a few days ago but didn’t think much of it as I wasn’t using the hardware pins in Blynk. Lesson learnt.
It works just fine… within the processor limits, aka don’t expect to use ALL 128 but I have used it, without issues, to allow bridging compatibility from a Nano to a Mega (due to the bridge referenced vPins on the Mega being in the higher range).