Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local outputstate = true
- local inputstate = 1
- while true do
- inputstate = redstone.getAnalogInput("back")
- if outputstate == true then
- if inputstate <= 1 then
- outputstate=false
- else
- print ("Discharging, power at "..inputstate)
- end
- else
- if inputstate >=14 then
- outputstate=true
- else
- print ("Charging, power at "..inputstate)
- end
- end
- redstone.setOutput("left",outputstate)
- os.sleep(2)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement