Hi, arduino uno struck randomly with the attached code(unable to post it due to character limit).
Code size is Sketch uses 22418 bytes (69%) of program storage space. Maximum is 32256 bytes. Global variables use 1111 bytes (54%) of dynamic memory, leaving 937 bytes for local variables. Maximum is 2048 bytes.
is size of code problem ? or did i messed up anything in the code ?
At a certain point the IDE will give you a warning about the memory usage. I have a few sketches that I optimized just enough to get rid of the warning and they run fine. You are seeing only the status, you do not have the warning message. I would not worry.
The example in the library is working fine with the current setup (I dont think i checked it long enough to notice freezing, will do that now).
so i think hardware may not be the problem.
Difference between example and working code is the following lines in the setup
// join I2C bus (I2Cdev library doesn't do this automatically)
#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE
Wire.begin();
Wire.setClock(400000); // 400kHz I2C clock. Comment this line if having compilation difficulties
#elif I2CDEV_IMPLEMENTATION == I2CDEV_BUILTIN_FASTWIRE
Fastwire::setup(400, true);
#endif
This all sounds odd considering you are using Serial.print() for debugging:
// There may be some conflict with softwareSerial and Servo Library So Hc-05 will be using Hardware Serial
//#include <SoftwareSerial.h> //Software Serial Library for HC-05 Bluetooth Module - this module act as a Slave and sends the data to the master or receive the data from master
//SoftwareSerial BTSerial(A0,A1); // TX, RX
. . .
. . .
Serial.begin(38400); //hc-05 is using hardware serial , 38400 is HC-05 Default Baud Rate
What, if anything, have you got connected to pins 0 and 1 ?
Robin2:
Are you saying that if you add those lines into setup() in the code in your Original Post then it will work properly?
If that is not what you are saying then there is more to the change than you have suggested.
...R
No, its not working even i added those lines,for other changes I am still looking but didnt find any
Edit : After i added those lines in setup code is struck in
while (!mpuInterrupt && fifoCount < packetSize) {
//Do nothing while mpu is not working
//they are saying it is a short delay .. i need a way to avoid this
Serial.print("waiting for mpu");
}//end of while loop
anilkunchalaece:
No, its not working even i added those lines,for other changes I am still looking but didnt find any
You seem to be coming at the problem backwards.
My Reply #7 was aimed at getting you you to start from a version that does work and then consider carefully why the subsequent changes caused it to stop working.
Working forward from something that works is much easier than working backwards from something that is broken.