[SOLVED] Problems pushing values from a Photon device to Blynk

Hi!.
i’m new to Blynk and on my first code, i just try to push a value from my Particle Photon to Blynk via Virtiual Pin V5. The code is the following:

#include "blynk/blynk.h"

#define BLYNK_PRINT Serial

char auth[] = "ELIMINATED"; // Put your token here

Timer mytimer(5000, sendUptime);  

void setup()
{
  Serial.begin(9600);
  delay(5000);
  Serial.println("Start"); 
  Blynk.begin(auth);

  mytimer.start();
}

void sendUptime()
{
  Blynk.virtualWrite(V5, millis() / 1000);
  Serial.println(millis() / 1000);
}

void loop()
{
  Blynk.run(); // all the Blynk magic happens here
}

However, when i run this code, no values are printed on the terminal, nor sent to blynk, and after a while, the status led on the device lights red, and it initilizes. In case i comment the line Blynk.virtualWrite(V5, millis() / 1000);, at least the values are printed on the terminal and it works fine … where is the problem with this code? Any help will be appreciated. Thanks

@fbt think you are missing the timer in loop().

Hi @Costas … as reported, in case i comment the line Blynk.virtualWrite(V5, millis() / 1000); it works ok ans the following values appear on the terminal, so i don’t think the problem is related to that.

Opening serial monitor for com port: "COM13"
Start
23
28
33
38
43

On photon, you need to use SparlCorePolledTimer

Thanks @vshymanskyy … now it works ok.