 #define NSENSORS 5
 #define PCA9547D_RESET 32
 #define VCNL4010_ADDRESS 0x13
-#define COMMAND_0 0x80  // starts measurements, relays data ready info
-#define PRODUCT_ID 0x81  // product ID/revision ID, should read 0x21
 #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

  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()

  WIRE.beginTransmission(VCNL4010_ADDRESS);
  WIRE.write(address);

  WIRE.endTransmission();
  WIRE.requestFrom(VCNL4010_ADDRESS, 1);

  while (!WIRE.available());
