You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Quốc Hùng edited this page Dec 20, 2022
·
1 revision
ERaTimer
Timer feature to send data in intervals. It allows you to send data intervals.
This is an example, how to send data(uptime) every second with a timer.
/* Create the timer object */
ERaTimer timer;
/* This function send uptime every second to Virtual Pin 1 */voidtimerEvent() {
ERa.virtualWrite(V1, millis() / 1000L);
}
voidsetup() {
/* Connecting to ERa */
ERa.begin(ssid, pass);
/* Setup timer called function every second */
timer.setInterval(1000L, timerEvent);
}
voidloop() {
/* Run ERa */
ERa.run();
/* Run ERaTimer */
timer.run();
}