Advertisement
TheSpicePhantom

FluxCompressorSteuerung

Aug 26th, 2016
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.10 KB | None | 0 0
  1. --Seite des Kompressors
  2. sc = "top"
  3. --NIX
  4. comp = peripheral.wrap(sc)
  5. mon = peripheral.find("monitor")
  6.  
  7. while true do
  8.     mon.setCursorPos(1,1)
  9.     mon.write("Druck: ")
  10.     if comp.getPressure() >= 5 then
  11.         mon.setCursorPos(8,1)
  12.         mon.setTextColor(colors.red)
  13.         mon.write(comp.getPressure())
  14.     elseif comp.getPressure() >= 1 then
  15.         mon.setTextColor(colors.yellow)
  16.         mon.write(comp.getPressure())
  17.     elseif comp.getPressure() >= 4.3 and <= 5 then
  18.         mon.setTextColor(colors.lime)
  19.         mon.write(comp.getPressure())
  20.     end
  21.     mon.setCurorPos(13,1)
  22.     mon.setTextColor(colors.white)
  23.     mon.write("Bar ")
  24.     mon.setCursorPos(1,2)
  25.     mon.write("Temp.: "..comp.getTemperature().. " C  ")
  26.     mon.setCursorPos(1,3)
  27.     mon.write("Status: ")
  28.     if comp.getPressure() >= 4.3 and <= 5 then
  29.         rs.setOutput(sc, true)
  30.         mon.setTextColor(colors.red)
  31.         mon.setCursorPos(9,3)
  32.         mon.write("DEAKTIVIERT")
  33.         mon.setTextColor(colors.white)
  34.     elseif comp.getPressure() <= 4.3 then
  35.         rs.setOutput(sc, false)
  36.         mon.setTextColor(colors.lime)
  37.         mon.setCursorPos(9,3)
  38.         mon.write("AKTIVIERT  ")
  39.         mon.setTextColor(colors.white)
  40.     end
  41. sleep(0.05)
  42. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement