Problem with connecting Nano v3 to Sharp Proximity Sensor
The problem is you are using i2c (the protocal behind the wire libary) to communicate with an analoge device. The sensor you have chosen returns the distance to the controller as an analog voltage in the range -0.3 to +2.8V (see the datasheet linked from the store page). Therefore you cannot communicate with it via a digital protocal.

To Make this work wire it up like this: 







simulate this circuit &ndash; Schematic created using CircuitLab

The code you need to control it should look something like this:

void setup()
{
  // Start serial connecton back to PC
  Serial.begin(19200);  
}

void loop()
{
  // Enable the sensor
  digitalWrite(15, HIGH);

  // Wait for it to turn on
  delay(100);

  // Read the analog value from the device
  value = analogRead(0);

  // power down the sensor
  digitalWrite(15, LOW);

  distance = /* do math here, see datasheet for typical values */; // Calculate the range in CM

  Serial.print("Distance is ");
  Serial.print(distance);
  Serial.println("CM");

  delay(50);
}


Also I would strongly recomend reading the datasheet of the device you have ordered carfully.

EDIT: I noticed that the code you are using is for the GP2Y0E02B not GP2Y0E02A. The GP2Y0E02B is digitally controlled over I2C, your GP2Y0E02A only outputs an analog value. Is it possible you ordered the wrong version of the sensor?