Help to Read Multiples Buttons (Poll)

Hi to all,

I want to monitor the state of multiple physical poll buttons with LED widget’s. I already can do it, but only with a single button. How to increase new buttons?

Digital 2 = Virtual 1:

This is more a “how to learn to code” question than a Blynk specific question.

Google for similar ways of scanning many buttons, learn how it is done with normal arduino code first. Perhaps look at something like for() to set incremental loops to run through x amount of switches:

https://www.arduino.cc/en/Reference/For

Then work on porting it over to a Blynk environment. Start with replacing the checkPin() in the main loop with a simpletimer… one switch is no problem, but you will quickly overload the communication link after repeating for a few more buttons while in the main loop (and avoid delay() whenever possible):

http://playground.arduino.cc/Code/SimpleTimer