Update getTime.lua
This commit is contained in:
parent
61dd93b280
commit
ed999ffe4c
1 changed files with 7 additions and 1 deletions
|
@ -1,4 +1,8 @@
|
||||||
local internet = require("internet")
|
local internet = require("internet")
|
||||||
|
local component = require("component")
|
||||||
|
local modem = component.modem
|
||||||
|
|
||||||
|
modem.open(69)
|
||||||
|
|
||||||
while true do
|
while true do
|
||||||
local handle = internet.request("http://worldclockapi.com/api/json/utc/now")
|
local handle = internet.request("http://worldclockapi.com/api/json/utc/now")
|
||||||
|
@ -17,5 +21,7 @@ while true do
|
||||||
f:seek("set", 44)
|
f:seek("set", 44)
|
||||||
local min = f:read(2)
|
local min = f:read(2)
|
||||||
f:close()
|
f:close()
|
||||||
print(date.." "..hour..":"..min)
|
local datetime = date.." "..hour..":"..min
|
||||||
|
print(datetime)
|
||||||
|
modem.broadcast(69, datetime)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue