I've got a simple elevator that uses frames & Motors, in case you Don't Use RP2 - every time a motor gets a pulse it move the frames in the direction the motor is pointing. I have 2 motors - One hooked up to a ORANGE Insulated cable (up) and one going down to WHITE Insulated cable.
To BLACK Insulated Cable I have hooked up a simple block detector (RS Torch, Repeater and Read Alloy Wire) that simply checks if the frames are on level 1 (To prevent the elevator going down when it's already on lowest level. (Note - the signal is inverted. Dunno why but it seemed easier to wire up.)
I think there may be an error in the BundledCable stuff - This is the second CC project I did using RP Bundled Cables.
The computer runs the programme (startup) but it seems to do bugger all when I press the relevant button (GRAY - up and LIME - down)
I re-written this programme like wat? 3 times by now? I tried functions, repeat until loops and alot of other stuff but I think I'm getting something wrong in the RS-BC API. I'm getting really annoyed that my massive building has no elevator :(/>
while rs.getInput("bottom") == true do –Shut off lever - in case I need to quickly switch it off.
CurrenFloor = nil –Reset Current Floor
if rs.testBundledInput("top", colours.black) == true then CurrenFloor = 2
elseif rs.testBundledInput("top", colours.black) ~= true then CurrenFloor = 1
end
oc = true
while oc == true do
if rs.testBundledInput("top", colours.grey) == true and CurrenFloor == 1 then
for i = 16, 1 do
rs.setBundledOutput("top", colours.add(rs.testBundledInput, colours.orange))
sleep(0.5)
rs.setBundledOutput("top", colours.subtract(rs.testBundledInput, colours.orange))
sleep(0.5)
end
oc = false
i = 0
elseif rs.testBundledInput("top", colours.lime) == true and CurrenFloor == 2 then
for i = 16, 1 do
rs.setBundledOutput("top", colours.add(rs.testBundledInput, colours.white))
sleep(0.5)
rs.setBundledOutput("top", colours.subtract(rs.testBundledInput, colours.white))
sleep(0.5)
end
oc = true
i = 0
end
end
end
Thanks for your help!