Ok, so I'm losing my mind here. Not that unusual for me, but this seems worse than usual.
All of a sudden my Arduinos can't do basic math. It's happening on several boards and with different sketches. I've tried updating my arduino ide from 1.0.2 to 1.0.3... still happening.
Test sketch:
void setup(){
Serial.begin(9600);
}
void loop(){
 unsigned long x=100*1000;
 long y=100*1000;
 int z=100*100;
 int q=500*120;
 Serial.println("Start");
 Serial.println(100000);
 Serial.println(x);
 Serial.println(y);
 Serial.println(z);
 Serial.println(q);
Â
Â
}
Serial Output reads:
Start
100000
4294936224
-31072
10000
-5536
I don't think I've messed with any of the core arduino functionality (and that should be fixed by using the new version?)
I've rebooted the computer (MacBookPro 2.4 Ghz intel core 2 duo, 4 GB ram, os 10.6.8) multiple times.
Loaded the following code to see if it was strictly a Serial monitor issue, but the LED didn't flash and the "X is under 200000" line didn't flash.
void setup(){
Serial.begin(9600);
pinMode (13,OUTPUT);//for led
}
void loop(){
 unsigned long x=100*1000;
  if (x<200000) {
   digitalWrite (13,HIGH);
   Serial.println("X is under 200000");
  }
  delay(200);
  digitalWrite (13,LOW);
  delay(200);
 Â
 Â
 long y=100*1000;
 int z=100*100;
 int q=500*120;
 Serial.println("Start");
 Serial.println(100000);
 Serial.println(x);
 Serial.println(y);
 Serial.println(z);
 Serial.println(q);
}
Any thoughts?? Compiler?? Operator error :~
Thanks,
Jon