Guest User

controldepresion

a guest
Oct 9th, 2016
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.55 KB | None | 0 0
  1. p = peripheral.wrap("back")
  2. presionmaxima = 3.6
  3. hola = true
  4. monitor = peripheral.wrap("top")
  5. while hola == true do
  6.   presionActual = p.getPressure()
  7.   monitor.write(presionActual)
  8.   monitor.setCursorPos(1,1)
  9.   monitor.clear()
  10.   term.clear()
  11.   term.setCursorPos(1,1)
  12.    
  13.    
  14.     if(presionActual > presionmaxima) then
  15.     print("funciona")
  16.     rs.setOutput("left",true)
  17.     presionActual = p.getPressure()
  18.     term.clear()
  19.     else
  20.     rs.setOutput("left",false)
  21.     presionActual = p.getPressure()  
  22.     term.clear()
  23.    end
  24.   sleep(2)
  25.   end
Advertisement
Add Comment
Please, Sign In to add comment