Kind of out of place but i have just find that while looking for something else and looks like i have been doing the following:
#define maxStpT 1250000
unsigned long mtrStpT = maxStpT+4;
unsigned long mtrSTTP = 1250000+4;
const unsigned long MAX = maxStpT+4;
const unsigned long MIN = 1250000+4;
void setup() {
Serial.begin (2000000);
}
void loop() {
Serial.print (mtrStpT);
Serial.print (" ");
Serial.print (mtrSTTP);
Serial.print (" ");
Serial.print (MIN);
Serial.print (" ");
Serial.println (MAX);
}
ALL i get through the serial monitor is
"1250004 1250004 1250004 1250004"
which looks about right.
Putting UL like :
const unsigned long MIN = 1250000ul+4;
still returns 1250004
BUT what about maxStpT ? Is there anything you guys would advise me to keep an eye on?
So anyone knows whether i should still use the ul after "1250000" or did they change the way maths are being done on the unsigned long?
All the above is also true when using * insead of +