Subroutines and do While Noob questions

This post has been removed.

Depending on your board, pin 0 may not be usable for interrupts.

Also, pins 0 and 1 are usually used for hardware serial communication, which you seem to be using.

Thanks, but am using pin 2 for the flow meter, and 6 for the button. I'm trying to work out why the code highlighted as // THIS IS THE CODE THAT DOESNT SEEM TO BE EXECUTING does not execute inline following the completion of the do while loop. Is i in the wrong place?

Your improperly posted and unformatted code is hard to read and follow. Read the forum guidelines to see how to properly post code and some good information on making a good post.
Use the IDE autoformat tool (ctrl-t or Tools, Auto format) before posting code in code tags.

You can go back and fix your original post by highlighting the code and clicking the </> in the menu bar.
code tags new

thank you :slight_smile:

Ah, my bad. I missed that you do not use digitalPinToInterrupt. Unformatted code is hard to read after all.

My next guess is that (watercount < FlushAmount) is always true, which would be the case if count is never incremented. Just as a test, if you change the following line

to

  count = 1;

The code outside of the do-while loop should be executed after 90 seconds or so.

The comment in this line does not match the code here by the way.

It would also help if you share what you see in the serial monitor.

Pin 6 is input, or output? The words say relay/LED, the code says input. ???
Pin 7 is never declared as an output.
Does that help?
C