Guest User

controldepresion

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