Greek

The following program statement can be re-stated in the plain words following the program statement:

  if ( (millis () - greenLEDtimer) >= greenLEDinterval)
     toggleGreenLED ();

That is to say: If the time at this instant, subtracted from the start time, is greater than or equals the required time, then the event (light LED) is complete.

Is this correct? The syllogism is elementary, the difficulty is reading the symbolic statement as a syllogism. Please discuss and critique.

Are you trying to get us to do your homework for you?

We don't have a Greek section. Do you want to rename your topic?

AWOL: We don't have a Greek section. Do you want to rename your topic?

I think the OP is trying to say that the code is "greek" to him. It is insufficient to me also, as greenLEDtimer, greenLEDinterval and toggleGreenLED are not defined.

If I were to guess, it is a common interval check utilizing the built in function millis() which returns an unsigned long integer of elapsed milliseconds.

Nick Gammon has written an excellent guide to proper use, and there have been several theads and posts covering this same use.

void setup() {
}

void loop() {
  unsigned long int processTimeStamp;
  unsigned long int processInterval = 10000UL;
  if (millis() - processTimeStamp >= processInterval) processTimeStamp = doTimedProcess();
}

unsigned long int doTimedProcess(){
  // turn on your LEDs or whatever needs done.
  return millis();
}

brianeo: That is to say: If the time at this instant, subtracted from the start time, is greater than or equals the required time, then the event (light LED) is complete.

I think you got that backwards. It's the start time subtracted from the time now. Or the time now minus the start time.

The post isn't in Cyrillic, so it clearly isn't Greek .

brianeo: The following program statement can be re-stated in the plain words following the program statement:

  if ( (millis () - greenLEDtimer) >= greenLEDinterval)
     toggleGreenLED ();

That is to say: If the time at this instant, subtracted from the start time, is greater than or equals the required time, then the event (light LED) is complete.

Is this correct? The syllogism is elementary, the difficulty is reading the symbolic statement as a syllogism. Please discuss and critique.

Close. The code tests whether or not a certain time interval has passed. Once it's passed, it's time to do something. There's no limit to what that something could be. You can start something, continue something, or stop something.

brianeo: That is to say: If the time at this instant, subtracted from the start time, is greater than or equals the required time, then the event (light LED) is complete.

That is essentially correct. Rather than say "the event (light LED) is complete" I would say "the time interval has expired"

The demo Several Things at a Time. It uses the same technique a number of times. I hope my variable names are a little more meaningful and may help with understanding the idea.

...R PS. Just realized I am duplicatiing Reply #6

That isn't a syllogism. A syllogism would be:

  if ( ((millis () - greenLEDtimer) >= greenLEDinterval) == (millis () - greenLEDtimer) >= greenLEDinterval))
     toggleGreenLED ();

One thing that I've learned about today's youth is that they love using big words and they think it makes them sound smart, but they have no clue what a dictionary is.

brianeo: The following program statement can be re-stated in the plain words following the program statement:

  if ( (millis () - greenLEDtimer) >= greenLEDinterval)
     toggleGreenLED ();

That is to say: If the time at this instant, subtracted from the start time, is greater than or equals the required time, then the event (light LED) is complete.

Is this correct? The syllogism is elementary, the difficulty is reading the symbolic statement as a syllogism. Please discuss and critique.

The subtlety with this code is that it is speficially not coded as:

 if (millis () >= greenLEDtimer + greenLEDinterval)
     toggleGreenLED ();

Because that will not work around millis() wrap-arounds.

The other subtlety is that it is going to toggle an awful lot once the condition is true because its likely called every time round loop(), the probably intention was to cancel the timer at this point, which takes another boolean variable perhaps, or a reseting of the greenLEDtimer value