From ec5c09fe377b6cbbdd0841d6e0f49ff1d43852c0 Mon Sep 17 00:00:00 2001 From: Brendan Le Foll Date: Tue, 6 Jan 2015 11:37:07 +0000 Subject: [PATCH] I2c-compass.cpp: fix incorrect usage of write/writeByte Signed-off-by: Brendan Le Foll --- examples/c++/I2c-compass.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/c++/I2c-compass.cpp b/examples/c++/I2c-compass.cpp index a17cb68..2345a87 100644 --- a/examples/c++/I2c-compass.cpp +++ b/examples/c++/I2c-compass.cpp @@ -95,7 +95,7 @@ int main () { float direction = 0; int16_t x = 0, y = 0, z = 0; - char rx_tx_buf[MAX_BUFFER_LENGTH]; + uint8_t rx_tx_buf[MAX_BUFFER_LENGTH]; //! [Interesting] mraa::I2c* i2c; @@ -116,7 +116,7 @@ int main () while (running == 0) { i2c->address(HMC5883L_I2C_ADDR); - i2c->write(HMC5883L_DATA_REG); + i2c->writeByte(HMC5883L_DATA_REG); i2c->address(HMC5883L_I2C_ADDR); i2c->read(rx_tx_buf, DATA_REG_SIZE); -- 2.7.4