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.
Fork of MPU6050 by
Diff: MPU6050.cpp
- Revision:
- 5:5bff0edcdff8
- Parent:
- 4:20f1f660e5c3
- Child:
- 6:5b90f2b5e6d9
--- a/MPU6050.cpp Wed Aug 05 12:17:44 2015 +0000
+++ b/MPU6050.cpp Wed Aug 05 12:45:47 2015 +0000
@@ -161,7 +161,9 @@
// Sample rate: 200Hz for gyro and acc
// Interrupts are disabled
void MPU6050::init()
-{
+{
+ i2c.frequency(400000); // fast i2c: 400 kHz
+
/* Wake up the device */
writeByte(MPU6050_ADDRESS, PWR_MGMT_1, 0x00); // wake up the device by clearing the sleep bit (bit6)
wait_ms(100); // wait 100 ms to stabilize
