Hi there,
I’m working on a raspberry Pi Zero W and I want to activate a GPIO pin in a particular moment in time.
I’m building an home garden water system and I want to activate a pump ( connected to a GPIO) at 8 PM every day.
I think that could achive this goal using the time obtained by an NTP server.
Could anyone suggest me how to obtain the NTP time? Is there a library to do that?
Thanks!
Fede
Moors7
2
1 Like
Thanks Moors.
I think to get the time from an NTP but I don’t know the easiest way that you suggested.
It’s very quick.
Thanks
I think you could use the date
command on Raspberry Pi:
// EXAMPLE USAGE
// Get entire output of program
Process proc = Process::run("date");
proc.wait();
String date = proc.out().readString();
You would get something like:
Sat Jul 1 12:36:06 EDT 2017
As the response.