Imagine I had a touchscreen interface with 6 buttons, each triggering it's own action, independent from each other, just triggered from the same computer, each starting a function that runs for a specific amount of time.
For example, button1: pump engines for 60 seconds; button2: trigger a lightshow for 60 seconds.
Now, as I have it currently setup, I have a
function1()
--dostuff
os.sleep(60)
end
function2()
--dostuff
os.sleep(60)
end
while true do
e, s, x, y = os.pullEvent("monitor_touch")
---dostuff, make button1 call function1 that runs for 60 seconds, make button2 call function2 that also lasts 60 seconds, etc
end
structure.
The problem with this is, when I press a button and the corresponding function runs, all the other functions are not available since they are started from the same program.
Is there a way to solve this, or would I need to make a wireless system where the touchscreen interface computer can send the tasks to other computers, so that each computer only has that one task, making all buttons permanently available.
There would be a slight problem with this again, I currently display the progress of the running function on the monitor.
That only works because the program goes to "function1", for example, and that function updates the screen.
Can multiple computers access the same monitor? If so, combining that with the wireless task-execution could work and even update multiple things on the monitor at once.