Do this...when all this happens...or repeat

Hello,

I'm going to keep it very short and straight to the point. I'm having trouble on how to write a line of code. This is what I want done when a set of commands are completed and than execute a line of code unless re checking the commands. In other words "do this.... when all this happens....or repeat"

Sorry it might be short but it is not straight to the point. I can make no sense of what you are trying to do, can you explain more fully?

Start reading the reference : - http://arduino.cc/en/Reference/HomePage and the tutorials - tutorials: http://arduino.cc/en/Tutorial/HomePage Time spent there may not be the greatest fun, but is well spent as you learn how an Arduino can be programmed.

wrt your question especially look at: http://arduino.cc/en/Reference/BooleanVariables http://arduino.cc/en/Reference/Boolean http://arduino.cc/en/Reference/If http://arduino.cc/en/Reference/While http://arduino.cc/en/Reference/DoWhile

Your pseudo code "do this.... when all this happens....or repeat" then becomes

boolean ready = false; do { if (all all this happens) { do this; ready = true; } } while (ready == false);

This code gives the structure

Edison, Thank you for all your references. I will sure to look into that. Thank you for the structure of the code, it's exactly what I was looking for.

I'm flattered but calling me Edison is really too much honour :)