Hi,
I am about to make an arduino based project where I need to turn on/off 4 relays automatically one after the other. Each need to be on for 6 hours. Also, I need a manual mode to overrule the auto mode, where it's possible to turn the relays on/off individually by using a keypad.
Also, I need a display to show which relay is currently running in auto mode, and to show info also in manual mode.
I am rather new to arduino programming, but figured I can't use the delay function. First, it wont allow me enough time I think (?), and second, while delay is running, I cannot interrupt and overrule the automode and switch to manual control.
So I have looked into the millis function, but I cannot for the life of me seem to figure out how to use it properly if I want info on LCD for each step.. also, it would be SO easy for me if I had only 2 relays I needed to switch between... that way I could just go with an if/else statement... but if I try that, all that I've tried, results in 1 LED (I use LEDs to illustrate the relays) turning on, then off, and then afterwards, LED2 turns on and off and either;
3rd LED follows LED2 simultaniously.. of some other mismatch occurs.
Anyone have some good advice on what I need to do? I would like the program to be as simple as possible.
In short:
Need to choose between manual and auto on keypad
If manual if chosen, be able to choose which LED(s) to turn on/off and also switch to auto mode
If auto is chosen, run LED 1 to 4 for 6 hours each one after the other, and be able to interrupt by keypress for maual control.
Be able to see which LED is lit on LCD display both in auto and manual mode.
