Posted 28 February 2012 - 02:00 AM
Ok after my run in to seeing clock made with wireless redstone and computercraft I am on the pursuit of making and coding my own clock… and yes i am quite aware of the clock program in the program section but I could get it to work and so on but It ended up making me want to make my own…
Now i wanted to start small and decide to make a program that takes a single digit panel of redpower lamps and the program running through 1-9 and 0 but didnt go as planned…
Heres the code it is so messy to be honest and probably can be condensed majorly
Code:
Edit:
This might help… screenshot of what i have set up
Image 2: [front view with the computer to bundled cable to wire to transmitter setup]
Now i wanted to start small and decide to make a program that takes a single digit panel of redpower lamps and the program running through 1-9 and 0 but didnt go as planned…
Heres the code it is so messy to be honest and probably can be condensed majorly
Code:
Spoiler
-- Digital number wireless test
--Clear all function
function clearall()
term.clear()
term.setCursorPos(1,1)
end
--number functions
--number 1
function numberone()
redstone.setBundledOutput("back", colors.red)
redstone.setBundledOutput("back", colors.yellow)
end
--number 2
function numbertwo()
redstone.setBundledOutput("back", colors.cyan)
redstone.setBundledOutput("back", colors.black)
redstone.setBundledOutput("back", colors.green)
redstone.setBundledOutput("back", colors.magenta)
redstone.setBundledOutput("back", colors.red)
end
--number 3
function numberthree()
redstone.setBundledOutput("back", colors.black)
redstone.setBundledOutput("back", colors.cyan)
redstone.setBundledOutput("back", colors.green)
redstone.setBundledOutput("back", colors.red)
redstone.setBundledOutput("back", colors.yellow)
end
--number 4
function numberfour()
redstone.setBundledOutput("back", colors.black)
redstone.setBundledOutput("back", colors.red)
redstone.setBundledOutput("back", colors.yellow)
redstone.setBundledOutput("back", colors.magenta)
end
--number 5
function numberfive()
redstone.setBundledOutput("back", colors.black)
redstone.setBundledOutput("back", colors.blue)
redstone.setBundledOutput("back", colors.green)
redstone.setBundledOutput("back", colors.cyan)
redstone.setBundledOutput("back", colors.yellow)
end
--number 6
function numbersix()
redstone.setBundledOutput("back", colors.cyan)
redstone.setBundledOutput("back", colors.black)
redstone.setBundledOutput("back", colors.red)
redstone.setBundledOutput("back", colors.blue)
redstone.setBundledOutput("back", colors.green)
redstone.setBundledOutput("back", colors.magenta)
end
--number 7
function numberseven()
redstone.setBundledOutput("back", colors.cyan)
redstone.setBundledOutput("back", colors.yellow)
redstone.setBundledOutput("back", colors.red)
end
--number 8
function numbereight()
redstone.setBundledOutput("back", colors.black)
redstone.setBundledOutput("back", colors.green)
redstone.setBundledOutput("back", colors.blue)
redstone.setBundledOutput("back", colors.red)
redstone.setBundledOutput("back", colors.cyan)
redstone.setBundledOutput("back", colors.yellow)
redstone.setBundledOutput("back", colors.magenta)
end
--number 9
function numbernine()
redstone.setBundledOutput("back", colors.black)
redstone.setBundledOutput("back", colors.yellow)
redstone.setBundledOutput("back", colors.red)
redstone.setBundledOutput("back", colors.cyan)
redstone.setBundledOutput("back", colors.green)
redstone.setBundledOutput("back", colors.magneta)
end
--number 0
function numberzero()
redstone.setBundledOutput("back", colors.red)
redstone.setBundledOutput("back", colors.green)
redstone.setBundledOutput("back", colors.blue)
redstone.setBundledOutput("back", colors.cyan)
redstone.setBundledOutput("back", colors.yellow)
redstone.setBundledOutput("back", colors.magenta)
end
--main program
print ("This program will now start the test.")
sleep(1)
print ("Count down to start...")
sleep(1)
print ("5")
sleep(1)
print ("4")
sleep (1)
print ("3")
sleep (1)
print ("2")
sleep (1)
print ("1")
sleep (1)
print ("Starting Procedure...")
sleep(.5)
numberone()
print ("1")
sleep(2)
numbertwo()
print ("2")
sleep(2)
numberthree()
print ("3")
sleep(2)
numberfour()
print ("4")
sleep(2)
numberfive()
print ("5")
sleep(2)
numbersix()
print ("6")
sleep(2)
numberseven()
print ("7")
sleep(2)
numbereight()
print ("8")
sleep(2)
numbernine()
print ("9")
sleep(2)
numberzero()
print ("0")
sleep(2)
print ("Done running test.")
sleep(1)
print ("Goodbye")
sleep(1)
clearall()
os.reboot()
Edit:
This might help… screenshot of what i have set up
Spoiler
Image1 [back view reciever to wire to lamp setup]Spoiler
Image 2: [front view with the computer to bundled cable to wire to transmitter setup]