Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- local gpu = component.gpu
- local state = 0
- local colors = require("colors")
- local minTempDisplay = 200
- local maxTempDisplay = 1200
- local w,h = gpu.maxResolution()
- local margin = 1
- local DPP = (maxTempDisplay-minTempDisplay)/(h-margin*2)
- local CORE = component.proxy("edc0b78a-94bc-4b92-9fb6-7ba2a6d6fdad")
- local CONTROL = component.proxy("587a8d4d-b2a7-4505-9a02-a84268a5d940")
- local raiseRodTemp = 600
- local lowerRodTemp = 700
- gpu.setResolution(w,h)
- CONTROL.lowerRods()
- while true do
- gpu.fill(margin,margin,1,h-margin," ")
- for i=margin,w-2*margin,1 do
- temp = CORE.getTemperature()
- gpu.fill(i+margin,margin,1,h-margin," ")
- gpu.setForeground(colors.grey,true)
- gpu.set(i,h-(lowerRodTemp/DPP+1),"▁")
- gpu.set(i,h-(raiseRodTemp/DPP+1),"▁")
- if temp >= 1000 then gpu.setForeground(colors.red,true) end
- if temp >= 400 and temp < 1000 then gpu.setForeground(colors.green,true) end
- if temp < 400 then gpu.setForeground(colors.blue,true) end
- gpu.set(i,h-(margin+temp/DPP),"█")
- if temp >= lowerRodTemp and state == 1 then
- CONTROL.lowerRods()
- state = 0
- gpu.setForeground(colors.white,true)
- gpu.set(i,h-(margin+temp/DPP),"█")
- end
- if temp <= raiseRodTemp and state == 0 then
- CONTROL.raiseRods()
- state = 11
- gpu.setForeground(colors.white,true)
- gpu.set(i,h-(margin+temp/DPP),"█")
- end
- os.sleep(0.02)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement