diff --git a/src/pca9685/pca9685.cxx b/src/pca9685/pca9685.cxx index d274c218..1b4e9bf3 100644 --- a/src/pca9685/pca9685.cxx +++ b/src/pca9685/pca9685.cxx @@ -33,12 +33,21 @@ using namespace upm; using namespace std; -PCA9685::PCA9685(int bus, uint8_t address) +PCA9685::PCA9685(int bus, uint8_t address, bool raw) { m_addr = address; // setup our i2c link - if ( !(m_i2c = mraa_i2c_init(bus)) ) + if ( raw ) + { + m_i2c = mraa_i2c_init_raw(bus); + } + else + { + m_i2c = mraa_i2c_init(bus); + } + + if ( !m_i2c) { cerr << "PCA9685: mraa_i2c_init() failed." << endl; return; diff --git a/src/pca9685/pca9685.h b/src/pca9685/pca9685.h index 52438189..d7b23cc8 100644 --- a/src/pca9685/pca9685.h +++ b/src/pca9685/pca9685.h @@ -183,7 +183,7 @@ namespace upm { * @param bus I2C bus to use * @param address Address for this device */ - PCA9685(int bus, uint8_t address = PCA9685_DEFAULT_I2C_ADDR); + PCA9685(int bus, uint8_t address = PCA9685_DEFAULT_I2C_ADDR, bool raw = false); /** * PCA9685 destructor