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

setting redstone pusles

Started by eightbitcrit, 20 January 2013 - 03:09 PM
eightbitcrit #1
Posted 20 January 2013 - 04:09 PM
hi all
i need help making a program that will do a redstone pulse x many time and that x= the amount you type in on the computer
theoriginalbit #2
Posted 20 January 2013 - 04:20 PM

local times = tonumber(read())

for i = 1, times do
  rs.setOutput( "bottom", true ) -- replacing bottom with the side to output
  sleep(0.1)
  rs.setOutput( "bottom", false ) -- replacing bottom with the side to output
end
eightbitcrit #3
Posted 20 January 2013 - 04:29 PM
i tried it out but it's not pulsing the amount i typed in
theoriginalbit #4
Posted 20 January 2013 - 04:30 PM
Oh oops I missed a sleep…that would always stay on… try this…

local times = tonumber(read())

for i = 1, times do
  rs.setOutput( "bottom", true ) -- replacing bottom with the side to output
  sleep(0.1)
  rs.setOutput( "bottom", false ) -- replacing bottom with the side to output
  sleep(0.4)
end
eightbitcrit #5
Posted 20 January 2013 - 04:31 PM
its now work

thx for the help!!!