testing
This commit is contained in:
parent
bafcdb7ff6
commit
d5b0bf5d25
@ -23,6 +23,7 @@ function poll()
|
||||
while true do
|
||||
if redstone_toggle_id ~= nil then
|
||||
rednet.send(redstone_toggle_id, "get_state")
|
||||
print('sent poll')
|
||||
end
|
||||
if de_store_mon_id ~= nil then
|
||||
-- todo
|
||||
@ -34,6 +35,7 @@ end
|
||||
function recv()
|
||||
while true do
|
||||
local id, data = rednet.receive()
|
||||
print("Message from " .. id .. ": " .. dump(data))
|
||||
if id == redstone_toggle_id then
|
||||
if type(data) == 'table' then
|
||||
if data[1] == 'output_state' then
|
||||
@ -66,7 +68,7 @@ function draw_screen()
|
||||
end
|
||||
print()
|
||||
term.setBackgroundColor(colors.black)
|
||||
sleep(3)
|
||||
sleep(1)
|
||||
end
|
||||
end
|
||||
|
||||
@ -81,5 +83,6 @@ end
|
||||
rednet.open(modemSide)
|
||||
rednet.host("rmm", "master")
|
||||
|
||||
parallel.waitForAny(poll, recv, draw_screen)
|
||||
-- parallel.waitForAny(poll, recv, draw_screen)
|
||||
parallel.waitForAny(poll, recv)
|
||||
rednet.close(modemSide)
|
||||
|
Loading…
x
Reference in New Issue
Block a user