@@ -258,13 +258,13 @@ uint8_t Adafruit_VL6180X::read8(uint16_t address)
258258{
259259 uint8_t data;
260260
261- Wire. beginTransmission (_i2caddr);
262- Wire. write (address>>8 );
263- Wire. write (address);
264- Wire. endTransmission ();
261+ _i2c-> beginTransmission (_i2caddr);
262+ _i2c-> write (address>>8 );
263+ _i2c-> write (address);
264+ _i2c-> endTransmission ();
265265
266- Wire. requestFrom (_i2caddr, (uint8_t )1 );
267- data = Wire. read ();
266+ _i2c-> requestFrom (_i2caddr, (uint8_t )1 );
267+ data = _i2c-> read ();
268268
269269#if defined(I2C_DEBUG)
270270 Serial.print (" \t $" ); Serial.print (address, HEX); Serial.print (" : 0x" ); Serial.println (data, HEX);
@@ -279,27 +279,27 @@ uint16_t Adafruit_VL6180X::read16(uint16_t address)
279279{
280280 uint16_t data;
281281
282- Wire. beginTransmission (_i2caddr);
283- Wire. write (address>>8 );
284- Wire. write (address);
285- Wire. endTransmission ();
282+ _i2c-> beginTransmission (_i2caddr);
283+ _i2c-> write (address>>8 );
284+ _i2c-> write (address);
285+ _i2c-> endTransmission ();
286286
287- Wire. requestFrom (_i2caddr, (uint8_t )2 );
288- data = Wire. read ();
287+ _i2c-> requestFrom (_i2caddr, (uint8_t )2 );
288+ data = _i2c-> read ();
289289 data <<= 8 ;
290- data |= Wire. read ();
290+ data |= _i2c-> read ();
291291
292292 return data;
293293}
294294
295295// write 1 byte
296296void Adafruit_VL6180X::write8 (uint16_t address, uint8_t data)
297297{
298- Wire. beginTransmission (_i2caddr);
299- Wire. write (address>>8 );
300- Wire. write (address);
301- Wire. write (data);
302- Wire. endTransmission ();
298+ _i2c-> beginTransmission (_i2caddr);
299+ _i2c-> write (address>>8 );
300+ _i2c-> write (address);
301+ _i2c-> write (data);
302+ _i2c-> endTransmission ();
303303
304304#if defined(I2C_DEBUG)
305305 Serial.print (" \t $" ); Serial.print (address, HEX); Serial.print (" = 0x" ); Serial.println (data, HEX);
@@ -310,10 +310,10 @@ void Adafruit_VL6180X::write8(uint16_t address, uint8_t data)
310310// write 2 bytes
311311void Adafruit_VL6180X::write16 (uint16_t address, uint16_t data)
312312{
313- Wire. beginTransmission (_i2caddr);
314- Wire. write (address>>8 );
315- Wire. write (address);
316- Wire. write (data>>8 );
317- Wire. write (data);
318- Wire. endTransmission ();
313+ _i2c-> beginTransmission (_i2caddr);
314+ _i2c-> write (address>>8 );
315+ _i2c-> write (address);
316+ _i2c-> write (data>>8 );
317+ _i2c-> write (data);
318+ _i2c-> endTransmission ();
319319}
0 commit comments