How to receive time?
-
Hi,
how can I get the time from the gateway?
this is what I call in the loop:
gw.requestTime(receiveTime);
this is the function:
void receiveTime(unsigned long time) { Serial.println(time); }
how do I get "time" out of this function as it is?
Sorry I'm not a big programmer.
Thanks for the help!
-
Hi,
I'm no programmer either but it seems like your variable named time should contain the time from the controller after you cal the requestTime(); function. The question is now what do you want to do with the time? In your example you just print the time to serial. Can you see the received time if you start Serial Monitor?
-
@Meister_Petz said:
Hi,
how can I get the time from the gateway?
this is what I call in the loop:
gw.requestTime(receiveTime);
this is the function:
void receiveTime(unsigned long time) { Serial.println(time); }
how do I get "time" out of this function as it is?
Sorry I'm not a big programmer.
Thanks for the help!
@Meister_Petz Your controller should support for this query. Gateway forwards this request to controller.
-
Probably I was unclear. time is showing up nicely. But home can I get this variable back to be used in "void loop"?
-
Define a variable at the start of your program and safe the time in the variable that can then be accessed from the main loop too.
-
@LastSamurai said:
Define a variable at the start of your program and safe the time in the variable that can then be accessed from the main loop too.
Many Thanks... obvious now...
-
@Meister_Petz Sometimes thats the most difficult problem
Glad to have helped!
Suggested Topics
-
Arduino Celebrates 10 years (Malmö/Sweden)
Announcements • 29 Mar 2014, 17:08 • hek 29 Mar 2014, 17:08 -
PJON and Minicore not working
Development • 27 days ago • Trand 27 days ago -
Counting Incoming and Outgoing Messages from a Gateway
Development • 10 Dec 2024, 21:57 • Trand 14 Dec 2024, 20:23 -
LAN8720A - will mysensors work with this module
Development • 13 Nov 2024, 17:06 • Marcin 15 Nov 2024, 10:59 -
Radio waking up for no reason.
Development • 4 Jul 2020, 21:09 • Sasquatch 15 Jan 2025, 08:33 -
Home Assistant/MySensors quirks
Development • 17 Mar 2025, 02:35 • OldSurferDude 17 Mar 2025, 02:35