I2c-compass.cpp: fix incorrect usage of write/writeByte
authorBrendan Le Foll <brendan.le.foll@intel.com>
Tue, 6 Jan 2015 11:37:07 +0000 (11:37 +0000)
committerBrendan Le Foll <brendan.le.foll@intel.com>
Tue, 6 Jan 2015 11:37:07 +0000 (11:37 +0000)
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
examples/c++/I2c-compass.cpp

index a17cb68..2345a87 100644 (file)
@@ -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);