Hi Everyone,
Newbie back again I’m afraid, this time I’m trying to get a MPU6050 working.
The only example code I am successful with is from Microdigisoft which works with a baud rate of 9600, and displays values on a OLED screen.
This is also used in the code line
void setup()
{
Serial.begin(9600);
I have my COM7 port set to 9600,8,1
However, I’ve tried numerous other example codes from other websites
(the latest is from Arduino | MPU6050 6-DoF Accelerometer and Gyro | Adafruit Learning System)
that all appear to use a baud rate of 115200 without success,
I’ve included monitor = 115200 in my platformio.ini file, and changed my COM7 port set to 115200,8,1
and the other code examples all start the same with:-
void setup()
{
Serial.begin(115200);
But the serial monitor always returns Failed to find MPU6050 chip, or doesn’t reply with anything?
I’d like to use these ‘other’ example files as they have more code which addresses some of the drawbacks with stabilisation and filtering of the raw values from the MPU6050.
Here is my platformio monitor output:
Warning! Ignore unknown configuration option monitor
in section [env:uno]
— Terminal on COM7 | 9600 8-N-1
— Available filters and text transformations: colorize, debug, default, direct, hexlify, log2file, nocontrol, printable, send_on_enter, time
— More details at Redirecting...
— Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H
K�␋
As you can see Terminal on COM7 | 9600 8-N-1 ‘Should’ be COM7 | 115200 8-N-1
My DeviceManager COM7 Port setting is 115200
I’m currently using an example (Test 5 so far from randomnerdtutorials) and this code is what displays the above:
void setup(void) {
Serial.begin(115200);
while (!Serial)
delay(10); // will pause Zero, Leonardo, etc until serial console opens
Serial.println("Adafruit MPU6050 test!");
// Try to initialize!
if (!mpu.begin()) {
Serial.println("Failed to find MPU6050 chip");
while (1) {
delay(10);
}
}
Serial.println("MPU6050 Found!");
What I find is if I alter the code and the .ini file and my COM7 port setting all to 9600 baud I actually get a response back, but it’s always “Failed to find MPU6050 chip”.
Many thanks in advance for help on this topic.