This commit is contained in:
navid.sassan 2021-04-02 16:45:43 +02:00
parent 0e55421e6f
commit fa8ad9eb7d

View File

@ -35,8 +35,10 @@ function recv()
local updated = false local updated = false
while true do while true do
local id, data = rednet.receive() local id, data = rednet.receive()
print("Message from " .. id .. ": " .. dump(data))
if id == redstone_toggle_id then if id == redstone_toggle_id then
if type(data) == 'table' then if type(data) == 'table' then
print('table')
if data[1] == 'output_state' then if data[1] == 'output_state' then
redstone_toggle_state = data[2] redstone_toggle_state = data[2]
updated = true updated = true
@ -67,7 +69,6 @@ function recv()
-- end -- end
-- print() -- print()
-- term.setBackgroundColor(colors.black) -- term.setBackgroundColor(colors.black)
sleep(1)
end end
end end
end end