OOPs sorry, wrong forum, this is hardware :o
I just started learning the programming language, so correct me if I'm being stupid.
in arduino.cc/en/Tutorial/Calibration schematic and wiring diagram
resistor voltage divider is connected to analogue 0 (pin 23/ADC0)
the sketch contains the line:
const int sensorPin = 2; // pin that the sensor is attached to
this seems to be an error