Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update MPU6050_DMP6.ino to stop Serial Freezes #759

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Arduino/MPU6050/examples/MPU6050_DMP6/MPU6050_DMP6.ino
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ MPU6050 mpu;
digital I/O pin 2.
* ========================================================================= */

/* =========================================================================
NOTE: If you are experiencing Freezes in the Serial then make sure you
pull down the AD0 pin and don't leave it floating. Some cheapo boards
now don't do this anymore.
* ========================================================================= */

/* =========================================================================
NOTE: Arduino v1.0.1 with the Leonardo board generates a compile error
when using Serial.write(buf, len). The Teapot output uses this method.
Expand Down Expand Up @@ -167,6 +173,7 @@ void setup() {
#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE
Wire.begin();
Wire.setClock(400000); // 400kHz I2C clock. Comment this line if having compilation difficulties
Wire.setWireTimeout(3000, true); //timeout value in uSec. Used to fix Serial Freezing after few secs
#elif I2CDEV_IMPLEMENTATION == I2CDEV_BUILTIN_FASTWIRE
Fastwire::setup(400, true);
#endif
Expand Down