Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local pressMax = 4.5
- w, h = term.getSize()
- comp = "left"
- lpr = "back"
- function centerprint(text, line)
- term.setCursorPos((w-string.len(text))/2, line)
- term.write(text)
- end
- function printScreen()
- term.clear()
- centerprint("SyståA8me de pression", 1)
- term.setCursorPos(1,2)
- print("Pression actuelle : "..actualPress)
- print("Pression souhaitåA9e ; "..pressMax)
- if actualPress >= pressMax then
- Working = "Non"
- else
- Working = "Oui"
- end
- print("Fonctionne : "..Working)
- end
- function main()
- while true do
- actualPress = rs.getAnalogInput(lpr)/2
- if actualPress < pressMax then
- rs.setOutput(comp,true)
- -- rs.setOutput("front",true)
- else
- -- rs.setOutput("front",false)
- rs.setOutput(comp,false)
- end
- printScreen()
- sleep(1)
- end
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement