How to use Virtual pin over Digital pin

Hello guys, I’m newbie to this I need little help (Related Virtual pin) with my first ever blynk project.
I’m using pushbutton.h library in my project
(GitHub - pololu/pushbutton-arduino: C++ library for the Arduino IDE that helps interface with pushbuttons by either reading the state of the button or monitoring it for press/release events)
cause I never used blynk before so I don’t know how to properly use Virtual pin.
I already gone through all the docs and also through some of forums but still not able to solve my problem
PROBLEM:: As I said I’m using pushbutton library in that library we have to declare pin number such as D5. For me digital pins are working fine but I want to use Virtual pin over Digital pin and that’s what the problem is for me.

Basically I want to use Virtual pin over here:
Pushbutton button (D5);
By replacing with D5

I know this is very silly problem :joy: but what should I do from yesterday I literally gone through every forum but not able to solve my problem

Sorry for my Bad English!!!

Virtual pins have their own version of the pushnutton library called BLYNK_WRITE(vPin) which is triggered when the state of the widget attached to t6he virtual pin changes.

Attempting to use virtual pins and the pushbutton library isn’t going to work.

If you want to learn how to use virtual pins to control physical GPIO pins you should read this:

Pete.

1 Like

Thanks for your support.

Actually my project is really simple that I want to control led patterns and their brightness with single pushbutton with blynk server support but I’m doing this for first time so it is little confusing for me.

Anyone who wants to help me with this please contact me: mehulwagh9669@gmail.com

That’s not a simple task when using Blynk, so I’d suggest looking at some of the posts in the “Projects made with Blynk” category and fine one that does what you want.

Pete.

Thanks Sir!!!