Go Down

Topic: Manipulation of timers to control seperate I/Os (Read 547 times) previous topic - next topic

markysparky

Good Afternoon, Please could someone help me.
I am a complete noob but am very keen to learn about this exciting world of Arduino.
I wish to start a project, where I build a board that houses 5 separate LED lights. These lights will indicate a product needed.
I have thought of using a separate PSU 12/24VDC and an Arduino Uno or Mega, to control an 8 channel 5V SSR Relay board.
On the back of the project board, I would put 5 pushbuttons that will be labeled for the corresponding products, that the LEDs will indicate. I will also have a 12VDC siren, as an audible alert that there is product needed. There would also be a separate Reset button, that can be pressed when the product has been delivered. This will reset the board.
Here is my issue. I would like for the LEDs to flash during their active state and the siren to be constant. However after a set period; say 30mins the Board would reset itself and people concerned would have to press the buttons again.
Please could someone help me with this code or point me in the direction with the timers.
Kind Regards
Mark :)

CrossRoads

#1
Feb 10, 2014, 06:51 pm Last Edit: Feb 10, 2014, 06:53 pm by CrossRoads Reason: 1
You don't need timers. Just use blink without delay style programming.

Your code will watch as millis() elapse, and when the appropriate 'time'  has passed make an output do something.
Use a couple of 'flags' to indicate whether an LED is in the flashing state or not.

Constant siren - I can see that being the first thing to become "disabled" 8)

See this topic
http://forum.arduino.cc/index.php?topic=216827.msg1585074#msg1585074
where a narrow pulse will occur every 10mS, expand the concept to 5 LEDs with different time intervals, and a longer interval that resets everything after 30 minutes.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

markysparky

Thankyou very much CrossRoads that has given me the start that I need.
I appreciate your guidance.  :)

Go Up