How to match widget names with arduino code?


so I’m newb and planing to work my way through a few of the examples via the examples builder.

It’s nice and obviously a lot of work to reach the current stage.

a few things not obvious to me atm.

  • how to match widgets selected to arduino code.
    ie: a terminal with input V1 is referenced by arduino code
    WidgetTerminal terminal(V1);

the example code is useful, but the range of possible widgets and the arduino code required to communicate with the widget is not obvious.

  • when to use digital output or virtual?
    looks like digital output maps to pin numbers on my ESP32 board, but how can I debug miss-mapped pins.

  • if I want to save a project as a file, how? I can see demos of how to export to a standalone app, but I want to export the project created and widgets with my arduino code in a git repo, then load back in at a later stage, proper configuration reproducability. is this possible?

otherwise, thanks. there’s some good work here, future me will probably see these questions as obvious, at moment the path forward is a bit blurred.



In the example that you linked to, which is the Blynk Blink sketch, it says:

 Blynk using a LED widget on your phone!

  App project setup:
    LED widget on V1

This is how you know which widget(s) to use for each of the examples, and which pins to attach those widgets to (Virtual pin 1 in this case).

Digital pins are a “quick and dirty” way to get up and running quickly, but you won’t find many of the regulars here using them. Virtual pins are very powerful and learning how to use them is the way to go.

Not exactly sure what you’re asking here. If you want to take a snapshot backup of your code and the corresponding app then storing a copy of the QR code for the app is probably the best way - certainly if you’re using the cloud servers. The way that QR codes work changed at some point in the past, and I think that they now contain the full app setup data for simple projects, but a pointer to the app for more complex ones.

The simplest way is probably to just add a table in your code comments (like the example above) which lists all the widgets used and what they are attached to.


1 Like