monitor=peripheral.wrap("monitor_0")
monitor.setTextScale(5)
function diplayTime()
local timeRaw = 0
local timeSec = 0
local timeMin = 0
local timeHrr = 0
while true do
monitor.clear()
monitor.setCursorPos(1,4)
monitor.write(timeRaw)
os.sleep(1)
timeRaw = timeRaw + 1
end
end
function breakLoop()
while true do
local event, par1 = os.pullEvent("key")
if par1 == 28 then
print("Ending Program.")
break
end
end
end
parallel.waitForAny(displayTime,breakLoop)
Program appears to freeze on run
Started by DragonZero, Sep 11 2016 04:13 AM
2 replies to this topic
#1
Posted 11 September 2016 - 04:13 AM
When I run this program, the computer appears to lock up. Ctrl + T and Enter both fail to end the program (ctrl + r works, though), and no text appears on the monitor.
#2
Posted 11 September 2016 - 04:55 AM
The only obvious problem I can see is the "diplayTime" typo, though I really would expect that to generate an error - are you sure this is the actual code you're running?
#3
Posted 11 September 2016 - 02:26 PM
Bomb Bloke, on 11 September 2016 - 04:55 AM, said:
The only obvious problem I can see is the "diplayTime" typo, though I really would expect that to generate an error - are you sure this is the actual code you're running?
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











