Simple timer problem

Hello there, I am a new Blynk user. Until now all the things I tried workt well!

The setup is an Arduino UNo and a NodeMcu v 1 board.

I use de generic ESP8266 libraries.

But now I get a compiler error when I use the Simple timer library.

timer.setInterval(1000,sendUptime); or timer.setInterval(1000L,sendUptime);

is dificult for the compiler it says sendUptime was not declared… But I insert the function like in the examples.

void sendUptime()
{
// This function sends Arduino up time every 1 second to Virtual Pin (V5)
// In the app, Widget’s reading frequency should be set to PUSH
// You can send anything with any interval using this construction
// Don’t send more that 10 values per second

Blynk.virtualWrite(V5, millis() / 1000);
}

please any help will be apriciated!!

André

Hi,

Have you included the library correctly and did you tried to run an simple timer example sketch on your board ?

Regards,
L

Hello Lieven. Thanks for the response. I used the latest library, at least I think, but the Arduino 1.6.6 IDE KEEPS COMPLAINING…

On this moment no way to solve it.

Any further suggestions?

Greetings Andre

@pa0akv Please post all code .

I think what Lieven is trying to ask, did you include the SimpleTimer library? And did you install that?

Hello all, problem solved.
It seems that it is very important to place home made functions in front of
void setup() and
void loop()

I did not see that before , but after I placed void schrijven() in front of them it works ok!


#define BLYNK_PRINT Serial // Comment this out to disable prints and save space

#include ESP8266WiFi.h
#include BlynkSimpleEsp8266.h
#include SimpleTimer.h

char auth[] = “…”;
SimpleTimer tijd;

void schrijven()
{
// This function sends Arduino up time every 1 second to Virtual Pin (V5)
// In the app, Widget’s reading frequency should be set to PUSH
// You can send anything with any interval using this construction
// Don’t send more that 10 values per second

Blynk.virtualWrite(V5, millis() / 1000);
}

void setup()
{
Serial.begin(9600);
Blynk.begin(auth, “Ziggoxxxx”, “xxxxxxxxx6”);

tijd.setInterval(1000, schrijven); // Here you set interval (1sec) and which function to call
}

void loop()
{
Blynk.run();
tijd.run();
}

But I am glad about the response! Nice working with Blynk!

1 Like

Glad it was solved. I’ve run your sketch to see if I could replicate the issue but before or after the “setup & loop” function worked fine. (my “schrijven” function are all at the end of my sketches without any issue)
I’ve tested without using the ESP8266 libraries but Ethernet.h & BlynkSimpleEthernet.h instead. not sure if there could be an issue. I also use the Arduino IDE version 1.6.5. (I had bugs & issues in the past with older Arduino IDE versions, so I stick to this one for a while)

happy sketching in het nederlands :smile:

groeten,
Lieven