question about variable definition

Hi all,

I defined a global timeout value, to make the code more readable, I used following clause:

long TimeOutValue = 5 * 60 * 1000; // 5 mins

the compile passed, but when I run the code, the timer expired very quickly.

so I changed it to:

long TimeOutValue = 300000;

then, everything works fine.

is this a compiler issue?

other Info: -Board: 2009 -IDE: 0018

Regards, James

Try this...

const long TimeOutValue = 5L * 60L * 1000L; // 5 mins

It is very likely that unsigned long is the correct datatype...

const unsigned long TimeOutValue = 5UL * 60UL * 1000UL; // 5 mins

[edit]Revised per PaulS's suggestion.[/edit]

The l (for long) is typically written using a L, to make it easier to distinguish from a 1. The difference between 1 and l is hard to see in some fonts. The difference between 1 and L is always distinguishable.