37 lines
820 B
Lua
37 lines
820 B
Lua
|
--[[
|
||
|
Programme for large smart screen in my base
|
||
|
|
||
|
- RSS feed
|
||
|
- Modular functions
|
||
|
- Time
|
||
|
|
||
|
Screen is 8 by 4 blocls
|
||
|
8
|
||
|
#############
|
||
|
############# 4
|
||
|
#############
|
||
|
#############
|
||
|
]]
|
||
|
local monitor_main = peripheral.find("monitor")
|
||
|
local x_max, y_max = monitor_main.getSize()
|
||
|
|
||
|
local monitor_clock = window.create(monitor_main, 1, 1, x_max / 8 * 3, y_max / 2)
|
||
|
local monitor_rss = window.create(monitor_main, x_max - x_max / 4, 1, x_max, y_max, true)
|
||
|
|
||
|
local modules = {
|
||
|
require("modules.clock").new(monitor_clock),
|
||
|
require("modules.rss").new(monitor_rss)
|
||
|
}
|
||
|
|
||
|
while true do
|
||
|
local calls = {}
|
||
|
for i, module in pairs(modules) do
|
||
|
--module.update()
|
||
|
table.insert(calls, module.update())
|
||
|
end
|
||
|
parallel.waitForAll(table.unpack(calls))
|
||
|
|
||
|
sleep(0.05)
|
||
|
end
|
||
|
|