Blynk works great to control pins and read pins using Particle Photon, but whenever I add a virtual pin it shows down to a crawl and goes on and off line a lot.
Reading the Blynk documents it says to add a timer like “SimpleTimer.h”, but this is an Arduino timer and I cannot load it into the Particle IDE. There is a timer from Spark called SparkIntervalTimer.h available, but I have been unable to implement it. (I don’t understand the example they give)
Does anyone have a easy way to add Virtual pins in Particle ? Or a simple example of a timer that works with Particle…
The code below reads the mills (uptime from Particle) and it works as a virtual pin, but it’s super slow and resets a lot.
thanks
Randy
```#include <blynk/blynk.h>
char auth[] = "771825b75e0c41778745953a*******";
#define PIN_UPTIME V5
void setup()
{
Serial.begin(9600);
delay(5000);
Blynk.begin(auth);
}
BLYNK_READ(PIN_UPTIME)
{
// This command writes Arduino's uptime in seconds to Virtual Pin (5)
Blynk.virtualWrite(PIN_UPTIME, millis() / 1000);
}
void loop()
{
Blynk.run();
}```