if( ..... anomoly

Hi, guys

I am confused with the following ..

When I use

    if ((currentMillis - FiveMinuteMillis) >= 300000) {

I get the execution I expect, but if I use

    if ((currentMillis - FiveMinuteMillis) >= (1000 * 60 * 5)) {

then the following code is skipped - as if 1000605 <> 300000

Both currentMillis and FiveMinuteMillis are unsigned long, and are initialised correctly

Thanks of any advice ...

You have to tell the compiler that you want to do multiplication of unsigned longs, compiler is not smart enough to guess it and will multiply ints by default (which results in an overflow, in your case) if you don't tell it otherwise.
At least one of those numbers must have 'UL' suffix:

if ((currentMillis - FiveMinuteMillis) >= (1000UL * 60 * 5)) {

Thanks so much, appreciate your prompt reply

You should set Preferences... -> Compiler warnings: to "ALL". Then you will be warned about such mistakes:

/Users/john/Documents/Arduino/sketch_nov18a/sketch_nov18a.ino: In function 'void loop()':
/Users/john/Documents/Arduino/sketch_nov18a/sketch_nov18a.ino:6:51: warning: integer overflow in expression [-Woverflow]
   if ((currentMillis - FiveMinuteMillis) >= (1000 * 60 * 5))
                                                   ^

This warns you that (1000 * 60 * 5) won't fit into a signed integer, the default data type.

/Users/john/Documents/Arduino/sketch_nov18a/sketch_nov18a.ino:6:42: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if ((currentMillis - FiveMinuteMillis) >= (1000 * 60 * 5))

This warns you that you can get unexpected results when you compare 'int' against 'unsigned long'.