I have an MPU 6050 and a BMP 180 and I need help combining both of the codes. I have checked and each of the codes work individually however when I try and merge them together, it gives me the error that "bmp" was not declared in this scope, even though they work fine by themselves. My two codes and the combined code are attached. Thank you in advance
Thank you for your quick response; I must add that I am quite new to all of this but in my original posting I added three files, the one that says combined code is what I am using and all that I did was double slash Adafruit_BMP085 bmp; from the document. I did not change anything else. Hopefully this helps
Please read the first post in any forum entitled how to use this forum. http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.
Sebnah:
all that I did was double slash Adafruit_BMP085 bmp; from the document.
That's not what spycatcher2k said though:
spycatcher2k:
Adafruit_BMP085 bmp;
Move this line out of the function.
Look at your working code- that line isn't in a function, where you have it just above setup. In your new code, that line's in a function. spycatcher2k asked you to move it out of the function, not zap it from the document.
void setup ()
{
stuff goes here
} < = that is the end of the SETUP function
then in your sketch, you have a combined sketch function
void dmpDataReady()
{
mpuInterrupt = true;
Adafruit_BMP085 bmp;
} < = that is the closing bracket on dmpDataReady() function
what you did, as SpyCatcher told you, is that you put a line in that function that is required for the rest of your sketch, but it is hidden inside of a function.