Need some clarification, can I run my arduino on Analog pin or Digital pin without using virtual PIN? Should I remove WidgetLED or change the led1 into D2 rather then V1. Thank you for you support
WidgetLED led1(V1);
BlynkTimer timer;
// V1 LED Widget is blinking
void blinkLedWidget()
{
if (led1.getValue()) {
led1.off();
SwSerial.println("LED on V1: off");
} else {
led1.on();
SwSerial.println("LED on V1: on");
}
}
void setup()
{
// Debug console
SwSerial.begin(9600);
// Blynk will work through Serial
// Do not read or write this serial manually in your sketch
Serial.begin(9600);
Blynk.begin(Serial, auth);
timer.setInterval(1000L, blinkLedWidget);
}
void loop()
{
Blynk.run();
timer.run();
}
Not sure if he has questions like me. Not everything is going to be controlled by Blynk. For instance I want to read a digital/analog pin on the Arduino only and do some control or decision making. That information may at some point go to the Blynk app of course. I guess it’s what the proper way of doing that now?
Blynk is a library that is integrated into your sketch…
While Blynk needs to be running, via Blynk.run() in order to facilitate any App/Server/vPin Requirements, it doesn’t “need” to control every direct GPIO or logic aspect of your code. You can easily have dedicated timers/functions/interrupts that do things without ever sharing data/control with the App… just by programming them as normal into your overall sketch. You just need to take into account the reguirments for non-blocking code.