Private
Public Access
2
0

I2c-compass.cpp: fix incorrect usage of write/writeByte

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll
2015-01-06 11:37:07 +00:00
parent 461015a22f
commit ec5c09fe37

View 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);