How many virtual pins are there?

HI,
I am confused by how many virtual pins there are I know the app has vo-v31 but I see code writing up in the hundreds. So how many are there and are these just used for storage and not widgets ?

Also what is the difference between ‘virtualwrite(V0,0)’ and ‘virtualwrite(0,0)’ ie without the V in front?
I have noticed this in a lot of code where the ‘V’ is omitted

Cheers

kev

There is no difference but I like to see the V preference as it makes the code clearer.

Basic hardware has 32 virtual pins, more powerful hardware has 128.

Thanks for that Costas, but what do you mean by more powerful hardware ??? Does a list exist of what has which somewhere ?

Cheers

Kev

Not AFAIK but you can tell when you select your hardware in the app. If it only has 32 virtual pins it’s considered weak and 128 is strong.

Nano’s and Uno’s weak. Mega’s and ESP’s strong.

ok Cheers Costas

so am I right in assuming that the ‘weak’ devices cannot use pins above 31 for just virtual storage of variables on the server?

Kev

Actually they can because there is a manual override you can set in your sketch to force quantity from 32 to 128.

I’m not going to say what it is because it might cause problems for the weak devices but primarily because I have forgotten the name of the flag. It’s covered on the site, let me know what search term you use to find the flag :slight_smile:

Apparently not in list format.

Searching for something as broad as virtual pin, nets way too much :astonished: But I did remember that it was @Dmitriy who mentioned it… thus virtual pins after:2016-12-01 @Dmitriy eventually netted the answer.… and it still isn’t documented :wink: that I could find.

#define BLYNK_USE_128_VPINS 
2 Likes

sorry link doesn’t work ???

@Costas

Found this so going to try it with an arduino

CostasOct '16
@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.

I tested it when @Eugene posted it and again now, fine from here.

I believe the mod is still required in the header file rather than the sketch.

Hi thanks Costas,

I will try the link again. Meanwhile I have modded the header so I have 128 V pins with a standard arduino and I can report at the moment it is working perfectly.

Thanks again!!!

Cheers

kev

1 Like

HI @Costas,

Link now working

Cheers

Kev

Can I use :
I=0
virtualwrite(I,0)

Thanks

@Kdb Use Forum Search and take note of the time date stamps of topics.