Oh So The Error That i get called failed to initialize Is Because The I2C Communication Was Not connected.
Is it?
Are you telling us, or are you asking?
Ok bro what should i do now should i use pullup resistors. If so what is the name of it??
Again:
How to know if it has them. And please tellme a way to contact you. Its veryhard to communicate here.
Bro i think The Board Has Inbuilt Pullup Resistors. It Is A MEGA.
I am sorry for you, but the chance that the chatGPT code is correct is nearly zero.
There is also near zero chance you will fix this today.
You really need to approach this step by step.
Find adequate library for your sensor.
Wire as recommended.
Run example from the library.
Build from there.
This forum is to help you program, not to correct chatGPT code.
Hearing This Iam Very Sad Because I Have A 3 Day Deadline For The Project.
I know that this platform is for helping in learning. But can u make an exception for me and Please Help Me in this code. Because Iam going to participate in competiton
Bro Please Tell If Any way to contact you. Do u have any social media?
That would be in the documentation. This is why it's important to get good documentation with stuff that you buy.
Can you go back to the shop and ask for advice?
Sorry, no - please keep to the forum.
If you really feel you're stuck, that's something you need to discuss with your teachers.
Although a working project is obviously the best outcome, presenting the problems you encountered and showing that you tried to debug them should get credit ...
Ok So Now Tell What to Do
Just Tell me the things to consider and The Tips To Make it work.
It will not help to fix the code if you do not know how to properly connect the sensor.
Easiest would be to get the same sensor on an adafruit board.
Alternative is add the pullup resistors (most probably it is not a problem if they are also on the board already... and then connect it like recommended in an adafruit tutorial. Run an example from their library and see what happens.
Yet another option would be to derive the schematic by looking at the board... it is not very complicated... but for you as a beginner probably very challenging too... And once you have the schematic you will still need help to make the correct connections...
run an I2C scanner and report here what was found
you can try with this code. MultiSpeed I2C Scanner - 50,100,200,400 KHz.
In this MPU6050 tutorial, the author has an extra library that you don't have.
He has:
#include <Adafruit_MPU6050.h>
#include <Adafruit_Sensor.h>
#include <Wire.h>
Try adding the missing Adafruit_Sensor library, or even use his code to verify your sensor's operation (his PCB looks as though it is the same as yours).
After reading that tutorial more thoroughly, I see that he also has the Adafruit BusIO library installed.
https://learn.adafruit.com/mpu6050-6-dof-accelerometer-and-gyro/arduino
Adafruit also use the same combination of libraries.
@rohith675, stop cross-posting. Threads merged.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.