Serial.println gives wierd results

Im using a potentiomenter to adjust the blinking rate of my diode, and im trying to output the read values + the modified time value into my serial monitor, but it gives me some wierd numbers.

sensorValue ranges from 0-1024

heres what i get from the monitor

sensor = 0
timer = 0
sensor = 9
timer = 2295
sensor = 93
timer = 23715
sensor = 1023
timer = -1279
  Serial.print("sensor = " );                       
  Serial.print("timer = " );                       
  Serial.println(1023*255); // added a test to see if it was the read value causing the errors.

Is there a limitation on how large an integer the println can print? Or am im doing it wrong ?

Please help :)


What types are the variables defined as? The type will determine how big the number can be before it starts rolling off bits.

the sensorValue is an int What datatype would be ideal for this purpose

i remember in other languages the limitations for integers was 64k; -32 -- 32k. does this apply for the arduino syntax?

I poked around in reference and changed the sensorValue to a long, and added another long to store the modified value. now it outputs the correct value.