I recently had a bug in my program and couldn't figure it out.
Turns out I'd typed count==25; instead of count=25;
I thought this would be an error or at least a warning. It isn't.
As an experiment I placed the following in a new sketch,
It compiles fine but count is displayed as 0.
Mike.
Edit, is this normal compiler behaviour? Just tried it in XC8 with the same result.
Turns out I'd typed count==25; instead of count=25;
I thought this would be an error or at least a warning. It isn't.
As an experiment I placed the following in a new sketch,
Code:
void setup(){
uint8_t count;
count==25;
Serial.begin(115200);
Serial.println(count);
}
void loop(){}
It compiles fine but count is displayed as 0.
Mike.
Edit, is this normal compiler behaviour? Just tried it in XC8 with the same result.