Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: BNO055_Adafruit SpriteIMU
Revision 2:8092160b6a59, committed 2015-09-16
- Comitter:
- simonscott
- Date:
- Wed Sep 16 22:32:29 2015 +0000
- Parent:
- 1:b48e4192c101
- Commit message:
- Changed I2C pins
Changed in this revision
| Adafruit_BNO055.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/Adafruit_BNO055.cpp Wed Sep 16 20:27:32 2015 +0000
+++ b/Adafruit_BNO055.cpp Wed Sep 16 22:32:29 2015 +0000
@@ -51,7 +51,7 @@
bool Adafruit_BNO055::begin(adafruit_bno055_opmode_t mode)
{
/* Enable I2C */
- i2c->frequency(100000);
+ //i2c->frequency(10000);
/* Make sure we have the right device */
uint8_t id = read8(BNO055_CHIP_ID_ADDR);
@@ -270,7 +270,8 @@
x = y = z = 0;
/* Read vector data (6 bytes) */
- readLen((adafruit_bno055_reg_t)vector_type, (char*)buffer, 6);
+ //readLen((adafruit_bno055_reg_t)vector_type, (char*)buffer, 6);
+ readLen((adafruit_bno055_reg_t)0x08, (char*)buffer, 6);
x = ((int16_t)buffer[0]) | (((int16_t)buffer[1]) << 8);
y = ((int16_t)buffer[2]) | (((int16_t)buffer[3]) << 8);
@@ -420,6 +421,8 @@
wait(0.001);
i2c->read(_address<<1, &to_read, 1, false);
wait(0.001);
+
+ printf(" I2C Read : %d from addr: %d\r\n", to_read, to_write);
return to_read;
}
@@ -437,6 +440,8 @@
i2c->read(_address<<1, buffer, len, false);
wait(0.001);
+ printf("I2C: Read %d bytes from address %d\r\n", len, reg_to_write);
+
/* ToDo: Check for errors! */
return true;
}