This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
UP844's profile picture

Elevator

Started by UP844, 30 March 2013 - 04:33 AM
UP844 #1
Posted 30 March 2013 - 05:33 AM
Recently I've been playing Feed the Beast (a lot) and experimenting with using computers with other mods. I decided to make a frame elevator that used a computer to use wireless redstone to move the elevator.

function down()
redstone.setOutput("left", true) --the transmitter is on the left side
sleep(2) --just so the motor can move the frames before it gets another current
redstone.setOutput("left", false)
end

down()
down()
down()
down()
down()
down()
down()
Theres also a program for up which is pretty much the same thing except the transmitter is connected to reciever behind the motor that makes it go up. My problem with this is it is just sending one continuous current not turning on and off like I want it to. Is this a problem with my code or a problem with wireless redstone.
Kingdaro #2
Posted 30 March 2013 - 05:46 AM
You should add a sleep after turning the signal off, so it doesn't immediately turn on when you call down() again.


function down()
redstone.setOutput("left", true)
sleep(1)
redstone.setOutput("left", false)
sleep(1)
end

I went ahead and lowered the first sleep too, to compensate for the amount of wait time you were going for.