#include "I2CDevice.h"

I2CDevice::I2CDevice(uint8_t address, TwoWire *twi) : address(address), twi(twi), isPresent(false)
{
  
}

boolean I2CDevice::begin()
{
  twi->begin(); //On rejoint le bus I2C en tant que master
  twi->beginTransmission(address);
  isPresent = twi->endTransmission() == 0;
  
  return isPresent;
}
