OK guys, new problem. :)/>
here's another part of code I'm writing that i'm having a problem with. I guess it's time I explain my plans for all the code. I am building a frame elevator. one computer on each floor(3 floors total) will control the elevator on that floor to is destination. So far I have working code for the floors, now I'm working on the coding of the 4th computer which controls the frame motors based on bundled inputs. When the elevator is on floor 1 it has a constant signal to grey, on floor two constant signal to cyan, and floor three is purple To move the elevator from floor 2 to floor 1, so far my coding below checks the back input. When I tell the computer on floor two that I want to go to floor 1 it outputs a yellow signal to back which feeds to the back of the controlling computer. Since the elevator is on floor 2 which emits a constant cyan signal, and the computer on floor 2 is adding a yellow signal to that, that makes cyan + yellow or 512+16. I have the controlling computer detect the bundled input and if it reaches 528 it executes the next line, which I want it to repeat until it reaches floor 1. To detect when it reaches floor 1 the bundled input will change to 256(light grey). Now here's where the breakdown is currently happening. When the bundled signal reaches 528 it kicks on the left output to orange, but it does not turn it off and on. I have a testing lamp attached to orange and it is continuously lit which means it's getting to that part and turns on the orange wire, but it is not turning it off so the frame motor can reset and turning it back on to make the frame motor move. The rest of the code works, because when i manually move the elevator down to the first floor it does detect a 256 bundled input and shuts off the orange wire. Anyone have any ideas as to why it will not pulse the bundled output to bit 2?
note: I have already tried moving the sleep in the function i created, however I cannot think of anything else to try.
--computer 5 control computer
--bit 1 is up, bit 2 is down
function d1()
rs.setBundledOutput("left", 2)
sleep(1)
rs.setBundledOutput("left", 0)
end
function u1()
rs.setBundledOutput("left", 1)
sleep(1)
rs.setBundledOutput("left", 0)
end
while true do
print(rs.getBundledInput("back"))
os.pullEvent("redstone")
if rs.getBundledInput("back")==528 then --528 is cyan and yellow
repeat
d1()
until rs.getBundledInput("back")==256
end
end