First post here, so I thought the beginners section would be best for now, especially since I'm quite new to Python. I've done some embedded work some years ago, so basic electronics needed here is pretty much straightforward and I mostly see a need for coding advice.
I'm looking to make a program (in Python -- but C isn't out of the question, if it's a far better choice; timing accuracy here isn't down to microseconds, but rather, a few seconds) to be able to independently turn on and latch an output for X minutes, with a system having up to 16 outputs. These outputs are supposed to stay on for a pre-set number of minutes to provide a device with power and then, once the set amount of minutes has passed, turn off to wait for a new "on" command to start running the timer again. Independent one-shot timers, in short, I guess.
In the end, I plan on having a touch screen GUI with, for example, a set of 4 x 4 boxes to represent these outputs that you can start/stop/reset individually by tapping on the desired box, but I'm not exactly sure how to start with the entire program. The outputs will be handled with a PCA9865-based I2C PWM board (but no PWM, just on/off for now, so duty cycle would be 0 % or 100 %). The GUI isn't something I need straight away, though, but rather getting the timers running independently of each other in a stable manner.
It would be most useful if everything was scalable, so I could set the number of outputs as a global constant, as well as set up the possible programs in code, each with its own amount of minutes. The amount of minutes would be given by a master selector (may end up being a physical multi-position switch) that is read when a timer is started to give the timer the required running time.
How should I structure the program to make is reasonably elegant and efficient? Threading, so that each output is controlled by a thread that is started by tapping the "box" and then gotten rid of once the timer runs down to zero? Does Python handle 16 simultaneous threads well? How about timestamping the start event and then comparing the current time with the starting time to see if their subtraction is long enough to warrant a stop and reset?
Sorry for the longish post, I know I'm probably asking quite a bit..