First of all, I've managed to do the decision using the variable increasing/decreasing + some eeprom writes/readouts.
Thank You for the advice.
I know, that in many cases is not necessary to read the output states, but my head stopped to work just after the word ''necessary''.
Therefore I'm open to any comments/tips & hints to improve software for my project, which will be used as
harddrive switch/selector in file server.
Let me explain:
Imagine that You have PC with 4 drives (we don't count the system-boot one) and this circuit/software will provide selection of drives (which to run) prior to powering on the server with some:
* fool-proof protection (to not turn the drives on/off while the system is running)
* status indication:
- RED LED: hard drive is off
- GREEN LED: hard drive is on
- YELLOW LED: status change requested, while the system is on (in this case switchover will be executed after the pc is turned off (+Vcc drops))
* control button (one per channel) with command delay (will do anything after holding down for 1s)
I still have to figure out where to connect RED LED, as I've run out of outputs on the chip, but I am sure I can feed it somehow through the inverter opposite 5V branch (maybe).
I've choosen 18M2 chip because it can run 4 separate programs, therefore I can have 4 separate channels.
I know, there might be a way to run it for 4 (or evenmore) channels without multi tasking, but my head is refusing any cooperation.
If You, or anyone else have an idea, how to extend it for 8 channels without adding another chip, please let me know.
Any help, or comment will be much appreciated.