diff --git a/api/mraa/i2c.hpp b/api/mraa/i2c.hpp index 54303c7..63106f5 100644 --- a/api/mraa/i2c.hpp +++ b/api/mraa/i2c.hpp @@ -120,9 +120,9 @@ class I2c { * @param length Size of read in bytes to make * @return pointer to std::string */ - std::string read(int length, uint8_t command) { + std::string read(int length) { uint8_t* data = (uint8_t*) malloc(sizeof(uint8_t) * length); - mraa_i2c_read(m_i2c, data, command, length); + mraa_i2c_read(m_i2c, data, length); std::string str((char*)data, length); free(data); return str; diff --git a/examples/i2c_HMC5883L.c b/examples/i2c_HMC5883L.c index 80e3650..dc3cbb6 100644 --- a/examples/i2c_HMC5883L.c +++ b/examples/i2c_HMC5883L.c @@ -116,7 +116,7 @@ main(int argc, char **argv) // chosen register mraa_i2c_address(i2c, HMC5883L_I2C_ADDR); // this call behaves very similarly to the Wire receive() call - mraa_i2c_read(i2c, rx_tx_buf, HMC5883L_DATA_REG, DATA_REG_SIZE); + mraa_i2c_read(i2c, rx_tx_buf, DATA_REG_SIZE); x = (rx_tx_buf[HMC5883L_X_MSB_REG] << 8 ) | rx_tx_buf[HMC5883L_X_LSB_REG] ; z = (rx_tx_buf[HMC5883L_Z_MSB_REG] << 8 ) | rx_tx_buf[HMC5883L_Z_LSB_REG] ;