I'm out of virtual pins

Dear all!!!
Can i use more than 32 virtual pins on same project;;;when i put a pin over 31 to my code on ide i m getting an error…

Some hardware units have 128 virtual pins. Describe your hardware in detail.

The way the 32 / 128 virtual pins works is basically like this:

The library checks if you have a “strong” processor and if you do it allocates you 128 virtual pins. If you have a weak processor you are allocated 32 virtual pins.

You can overwrite the flags to give any hardware 128 virtual pins but then you run the risk of a system that is not able to cope with the extra processing power required.

I see…Thanks costas!!i was a little bit confused…Now im working with mega and if everything work fine im going to use Due…If isn’t problem i would like to know how to “overwrite the flags”…i want 60 virtual pins to complete my project…
Thank’s again for your response!!!

@Spyrosgreece if you look at the Blynk.Config.h header file in Blynk/src/Blynk folder there is this entry:

// Uncomment to force-enable 128 virtual pins
//#define BLYNK_USE_128_VPINS

So as it suggests if you uncomment the second line it will force 128 virtual pins. It is either 32 or 128, nothing in between but obviously you use as many of these as you need.

I’m guessing here but if you didn’t want to mess with the libraries, as this will need to be done every time Blynk releases a new version, then simply adding the following before the Blynk libraries in your sketch might work.

#define BLYNK_USE_128_VPINS

Perhaps @vshymanskyy could confirm if this entry in the sketch is ok, rather than a library mod.

Meanwhile you can perhaps test it yourself and let us know the outcome.

No, sketch is not sufficient unfortunately.
I’ll make this enabled for mega and due.

1 Like

Thanks for your prompt response @vshymanskyy

1 Like

Thank you both @Costas @vshymanskyy !!!
I will try to modify Config.h file tonight and i will let you know the outcome.

Hello to everyone!!!23 ago i was modify blynk_config.h to use all virtual pins on mega…The project runs for 23 days with no any errors…Every second the code update 12 virtual pins…8 virtual leds and 4 values displays!!But today everythink works nice but i don’t take any data on history graph…