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 component = require("component")
|
||||
local modem = component.modem
|
||||
|
||||
modem.open(69)
|
||||
|
||||
while true do
|
||||
local handle = internet.request("http://worldclockapi.com/api/json/utc/now")
|
||||
|
@ -17,5 +21,7 @@ while true do
|
|||
f:seek("set", 44)
|
||||
local min = f:read(2)
|
||||
f:close()
|
||||
print(date.." "..hour..":"..min)
|
||||
local datetime = date.." "..hour..":"..min
|
||||
print(datetime)
|
||||
modem.broadcast(69, datetime)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue