Read value and wait

Hi!

I am making a program that is going to give a constant PH value of 7. If the value goes below or over 7, then a pump while start and pump in base or acid. I have made it so that we can decide the time of how long the pumps will run until they stop. After they stop, I want a timer to start and run for some time while we check the value on analog input 0. (This is because the solution should get some time to stabilize).

Can anyone help me with this loop where nothing else than the analog input 0 is being read, is happening for a specific amount of time?

Thanks in advance!

Kristian

Forgot to post my program...

Attached below

Constant_PH.ino (1.76 KB)

Can anyone help me with this loop where nothing else than the analog input 0 is being read, is happening for a specific amount of time?

Sounds like you need to use millis() for timing.

Read Using millis() for timing. A beginners guide and Several things at the same time and look at the BlinkWithoutDelay example in the IDE.