Guest User

controldepresion

a guest
Oct 6th, 2016
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.58 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.   monitor = peripheral.wrap("top")
  7.   presionActual = p.getPressure()
  8.   monitor.write(presionActual)
  9.   os.pullEvent("redstone")
  10.  
  11.    
  12.    
  13.     if(presionActual > presionmaxima) then
  14.     print("funciona")
  15.     redstone.setOutput("back",true)
  16.     monitor.clear()
  17.     monitor.setCursorPos(1,1)
  18.     monitor.write(presionActual)
  19.     else
  20.     redstone.setOutput("back",false)
  21.     monitor.clear()
  22.     monitor.write(presionActual)  
  23.  
  24.    end
  25.   sleep(1)
  26.   end
Advertisement
Add Comment
Please, Sign In to add comment