As part of a larger project I set up a basic timeout in a while loop but I ran into a strange problem in the process and I was hoping someone could shed some light on this.
This example sketch shows how I was trying to declare my timeout variable. I would expect this to print something close to 900000 but it prints 4294949792
If I do timeout = millis() + (10 * 10 * 10)
I get 1000 like I would expect
By default, an integer constant is treated as an int with the attendant limitations in values. To specify an integer constant with another data type, follow it with:
a 'u' or 'U' to force the constant into an unsigned data format. Example: 33u
a 'l' or 'L' to force the constant into a long data format. Example: 100000L
a 'ul' or 'UL' to force the constant into an unsigned long constant. Example: 32767ul