From 40cb639ea47b272202f463461405b078cb918877 Mon Sep 17 00:00:00 2001 From: Christian Zufferey Date: Tue, 9 Jun 2020 18:39:47 +0200 Subject: [PATCH] wip --- .../energy/transfo_courant_clip_1p_1/boot.lua | 34 ++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/Mesures/energy/transfo_courant_clip_1p_1/boot.lua b/Mesures/energy/transfo_courant_clip_1p_1/boot.lua index fd0d0a9..c5b8b14 100644 --- a/Mesures/energy/transfo_courant_clip_1p_1/boot.lua +++ b/Mesures/energy/transfo_courant_clip_1p_1/boot.lua @@ -1,9 +1,41 @@ -- Scripts à charger après le boot pour démarrer son projet -print("\n boot.lua zf200607.1625 \n") +print("\n boot.lua zf200607.1655 \n") -- function ztime_stamp() return tmr.now()/1000000 end +sntp.sync(nil, nil, nil, 1) + +function ztime_format(ztime) + tm = rtctime.epoch2cal(ztime + 3600) + return(string.format("%04d/%02d/%02d %02d:%02d:%02d", tm["year"], tm["mon"], tm["day"], tm["hour"], tm["min"], tm["sec"])) +end + +print(ztime_format(rtctime.get()+3600)) + +zsec, zusec = rtctime.get() + +print(zsec, zusec) +zsec=zsec+3600+zusec/1000000 +print(ztime_format(zsec)) + +print(zsec) +znanosec= zsec*1000000000 +print(znanosec) + + + + + + + + + + + + + + function boot() verbose = true print("On lance le boot...")