   WIRE.beginTransmission(VCNL4010_ADDRESS);
   WIRE.write(address);
 
-  debug_endTransmission(WIRE.endTransmission());
+  WIRE.endTransmission();
   WIRE.requestFrom(VCNL4010_ADDRESS, 1);
 
   while (!WIRE.available());

  WIRE.beginTransmission(VCNL4010_ADDRESS);
  WIRE.write(address);
  WIRE.write(data);
  return debug_endTransmission(WIRE.endTransmission());
}

unsigned int readAmbient()
{
  byte temp = readByte(0x80);
  writeByte(0x80, temp | 0x10);  // command the sensor to perform ambient measure

  while (!(readByte(0x80) & 0x40)); // wait for the proximity data ready bit to be set
  unsigned int data = readByte(0x85) << 8;
  data |= readByte(0x86);

  return data;
}

unsigned int readProximity()

#define NSENSORS 5
#define PCA9547D_RESET 32
#define VCNL4010_ADDRESS 0x13
#define IR_CURRENT 0x83  // sets IR current in steps of 10mA 0-200mA
#define IR_CURRENT_VALUE 8  // range = [0, 20]. current = value * 10 mA
#define AMBIENT_PARAMETER 0x84  // Configures ambient light measures
