Posted 01 August 2016 - 03:02 PM
Hi
My Name is Perdigero96.
I programmed a program for the doorbell of a house; the idea was that when the bell call at an advanced screen out a message saying someone had called with two options to allow or deny entry; the thing is that soon after turning on the computer gives me an error saying "Peripheral:40: Too long without yielding"
Someone can check the code and tell me what is the fail?
This is the code:
My Name is Perdigero96.
I programmed a program for the doorbell of a house; the idea was that when the bell call at an advanced screen out a message saying someone had called with two options to allow or deny entry; the thing is that soon after turning on the computer gives me an error saying "Peripheral:40: Too long without yielding"
Someone can check the code and tell me what is the fail?
This is the code:
- while true do
mon = peripheral.find("monitor")
mon.clear()
x=redstone.getInput("back")
if x == true then
mon.setCursorPos(12,6)
mon.write("Someone had called")
mon.setCursorPos(20,9)
mon.write("¿Can entry?")
mon.setCursorPos(15,15)
mon.write("YES")
mon.setCursorPos(35,15)
mon.write("NO")
event, side, xPos, yPos = os.pullEvent("monitor_touch")
print(xPos)
print(yPos)
if xPos == 16 and yPos == 15 then
rednet.open("bottom")
rednet.broadcast("granted")
rednet.broadcast("puerta")
rednet.close()
elseif xPos == 35 and yPos == 15 then
rednet.open("bottom")
rednet.broadcast("denied")
rednet.close()
end
end
end