reef aquarium controller

hey guy i have some problem whit progamming my aquarium controller
the controller is going to look as follow

i have got 2 float switch 1 for refilling waterlevel
one to prevent my pump for dry running

i also got a temperture sensor

also i am going to control my light whit this unit
in total 11 relay (8+4 relayboard)
6x light ( red ATS ,rgb night,Royal blue,Royalblue,20k white, 20k
1 X return pump
1 X flow pump
1 x heater
1 x cooling
i had it al working seperatly an this worked fine.
but when i wanted to program the code voor mine 9 switch/; push button is didn't work any more.
I can steer 1 button at the tim but this not enough.
it are going to be 5 pushbutton+ 2 waterlevel switch+2 key switch.
any tip for programming more than 1 push button.
I tried to search but couldn't the code I wanted .

The technique as described in "blink without delay" example is essential to master if you want to do multiple things simultaneously,
So you should start there.

robtillaart:
The technique as described in "blink without delay" example is essential to master if you want to do multiple things simultaneously,
So you should start there.

I see so much pushing of people to "blink without delay" examples.
While it is a way do things, the way those examples code things, it is not the only way.
In fact there are other ways to multiple things that can be cleaner and easier from a sketch coding
perspective.
There are several libraries that can be used to schedule your tasks which can make things
simpler and cleaner than using the "blink without delay" coding methodology.
Libraries that use timer interrupts can be particularly beneficial and can do things
that blink with out delay cannot do like high priority background priority processing.

So while blink without delay can be used, I'd encourage people to look at some
of the existing libraries for task scheduling before going down the blink without delay path.
In my view there is simply no need to drop down to the "blink without delay" coding
since there are libraries out there that can do the same thing or better.

Some of what will determine the direction of what to use and which way to go will be
guided by the overall architecture of the system.
i.e. are there real time events that need to be processed? If so interrupts will be needed.
Are are there many events or just a few?
etc...

Here are a a few libraries to consider:
Metro: Arduino Playground - HomePage
works similar to "blink without delay" but uses C++ objects for event task checking.
You create a metro object for each desired task & interval and loop() polls for the event
and when the event occurs, calls the desired function.
I would use this over typical "blink without delay" coding - as it is the same methodology but cleaner
from a coding perspective.

Timer: Arduino Playground - HomePage
This library takes things to higher level by combining scheduled events and pin control.
It is very good for handling things like controlling output pins for timed durations
as well as event scheduling.
additional documentation: Dr. Monk's DIY Electronics Blog: Arduino Timer Library

softtimer: Google Code Archive - Long-term storage for Google Code Project Hosting.
This library also includes some examples for things like switch debouncing,
and tone/sounds.

mstimer2: Arduino Playground - HomePage
flexitimer2: Arduino Playground - HomePage
These provide a realtime event callback using a h/w timer.
While providing true realtime event scheduling, care must be taking as to what and
how much is done in the event processing routine since the event function is
called at interrupt level.

--- bill