Hi,
I have a project where Im using the Blynk app with a relay board and Particle Photon. Because I need to control 16 outputs, I use a few digital and analog port as a digital OUTPUT.
I have a random problem with the Blynk App. When I stop the dashboard or don’t use it for a few hours the status of a the buttons associate to analog ports change to “OFF” but are “ON” in the hardware.
For example, I have 16 button turned ON, if I close the iPhone app, and open it again, a the ANALOG associate buttons in the app change state to OFF, but are ON in hardware. The digital pins button kept the state.
How I can kept the sync between the blank app and the hardware in analog output pin?
My code is very simple:
#define BLYNK_PRINT Serial
#include “blynk/blynk.h”
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = “xxxxxx”;
// No coding required for direct pin operations!
void setup()
{
Serial.begin(9600);
delay(5000); // Allow board to settle
Blynk.begin(auth);
}
// Keep this flag not to re-sync on every reconnection
bool isFirstConnect = true;
// This function will run every time Blynk connection is established
BLYNK_CONNECTED() {
if (isFirstConnect) {
Blynk.syncAll();
isFirstConnect = false;
}
}
void loop()
{
Blynk.run();
}
Thanks for help.