projects
/
contrib
/
mraa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
461015a
)
I2c-compass.cpp: fix incorrect usage of write/writeByte
author
Brendan Le Foll
<brendan.le.foll@intel.com>
Tue, 6 Jan 2015 11:37:07 +0000
(11:37 +0000)
committer
Brendan 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
patch
|
blob
|
history
diff --git
a/examples/c++/I2c-compass.cpp
b/examples/c++/I2c-compass.cpp
index
a17cb68
..
2345a87
100644
(file)
--- 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->write
Byte
(HMC5883L_DATA_REG);
i2c->address(HMC5883L_I2C_ADDR);
i2c->read(rx_tx_buf, DATA_REG_SIZE);