Feather_Holiday_Lights/Feather_32u4_Lights/Adafruit_VCNL4000.cpp
uint8_t Adafruit_VCNL4000::read8(uint8_t address)
{
  uint8_t data;

  Wire.beginTransmission(VCNL4000_ADDRESS);
#if ARDUINO >= 100
  Wire.write(address);
#else
  Wire.send(address);
#endif
  Wire.endTransmission();

  delayMicroseconds(170);  // delay required

  Wire.requestFrom(VCNL4000_ADDRESS, 1);
  while(!Wire.available());

#if ARDUINO >= 100
  return Wire.read();
#else
  return Wire.receive();
#endif
}
// Read 1 byte from the VCNL4000 at 'address'
Read 1 byte from the VCNL4000 at 'address'
Read 1 byte from the VCNL4000 at ' address '
uint8_t Adafruit_VCNL4000::read8(uint8_t address)
{
  uint8_t data;
  Wire.beginTransmission(VCNL4000_ADDRESS);
#if ARDUINO >= 100
  Wire.write(address);
#else
  Wire.send(address);
#endif
  Wire.endTransmission();
  delayMicroseconds(170);  
  Wire.requestFrom(VCNL4000_ADDRESS, 1);
  while(!Wire.available());
#if ARDUINO >= 100
  return Wire.read();
#else
  return Wire.receive();
#endif
}
uint8_t Adafruit_VCNL4000 :: read8 ( uint8_t address ) { uint8_t data ; Wire . beginTransmission ( VCNL4000_ADDRESS ) ; #if ARDUINO >= 100 Wire . write ( address ) ; #else Wire . send ( address ) ; #endif Wire . endTransmission ( ) ; delayMicroseconds ( 170 ) ; Wire . requestFrom ( VCNL4000_ADDRESS , 1 ) ; while ( ! Wire . available ( ) ) ; #if ARDUINO >= 100 return Wire . read ( ) ; #else return Wire . receive ( ) ; #endif }
Read 1 byte from the VCNL4000 at 'address'
Read 1 byte from the VCNL4000 at ' address '
// delay required