Error message with Adafruit_BMP085 libraries
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- ChrisCSD
- Posts: 3
- Joined: Fri Oct 31, 2014 12:34 pm
Error message with Adafruit_BMP085 libraries
I trying to running your test code for the Bosch BMP180 pressure sensor.
I am using windows 7 and installed the Arduino IDE and Arduino UNO with no problems.
When I run the test code I keep getting 'Adafruit_BMP085' does not name a type.
I have copied the library files to:
C:\Users\Chris\Documents\Arduino\Libraries
right now I have 2 folders
Adafruit_BMP085
Adafruit_Sensor
I have tried running the code several ways, including renaming the folders, the header files and the cpp files. Also making sure the #includes in the test code matches the actual header and cpp files.
Thanks for any help!
Christopher
I am using windows 7 and installed the Arduino IDE and Arduino UNO with no problems.
When I run the test code I keep getting 'Adafruit_BMP085' does not name a type.
I have copied the library files to:
C:\Users\Chris\Documents\Arduino\Libraries
right now I have 2 folders
Adafruit_BMP085
Adafruit_Sensor
I have tried running the code several ways, including renaming the folders, the header files and the cpp files. Also making sure the #includes in the test code matches the actual header and cpp files.
Thanks for any help!
Christopher
- adafruit_support_bill
- Posts: 89768
- Joined: Sat Feb 07, 2009 10:11 am
Re: Error message with Adafruit_BMP085 libraries
That means that the compiler was not able to locate the files in the expected location.Adafruit_BMP085' does not name a type.
That sounds like the correct location. A couple things to try:I have copied the library files to:
C:\Users\Chris\Documents\Arduino\Libraries
1) make sure that you exit and re-start the IDE (close all of them if you have multiple copies open). The IDE won't see libraries that are installed after it starts.
2) Check File->Preferences to verify that "C:\Users\Chris\Documents\Arduino" is actually the location of your sketchbook folder.
For more information, see this guide: http://learn.adafruit.com/adafruit-all- ... nstall-use
- ChrisCSD
- Posts: 3
- Joined: Fri Oct 31, 2014 12:34 pm
Re: Error message with Adafruit_BMP085 libraries
I renamed the .h and cpp files back to Adafruit_BMP085_U and looked under File\example and I did show
the example for Adafruit_BMP085. I loaded the file instead of pasting it in from the website and it compiled and load!
Just went to the Serial monitor and I am getting readings! Sweet, thanks for your help. Still not sure why it was not working as
I had done all of the things you had recommended. Maybe pasting the code in without saving to a file was an issue? I assume that all of the sketch projects should be saved under the Arduino folder, each in their own subfolder correct? Thanks again for the help Bill!
the example for Adafruit_BMP085. I loaded the file instead of pasting it in from the website and it compiled and load!
Just went to the Serial monitor and I am getting readings! Sweet, thanks for your help. Still not sure why it was not working as
I had done all of the things you had recommended. Maybe pasting the code in without saving to a file was an issue? I assume that all of the sketch projects should be saved under the Arduino folder, each in their own subfolder correct? Thanks again for the help Bill!
- adafruit_support_bill
- Posts: 89768
- Joined: Sat Feb 07, 2009 10:11 am
Re: Error message with Adafruit_BMP085 libraries
Yes. If you save from the IDE, it will automatically create the folder for you.I assume that all of the sketch projects should be saved under the Arduino folder, each in their own subfolder correct?
- ChrisCSD
- Posts: 3
- Joined: Fri Oct 31, 2014 12:34 pm
Re: Error message with Adafruit_BMP085 libraries
ok, the problem was 2 things
the header and cpp file had to have the _U on the end!
and this line was not working,
Adafruit_BMP085 bmp = Adafruit_BMP085(10085);
it needed to be this!!!
Adafruit_BMP085_Unified bmp = Adafruit_BMP085_Unified(10085);
looks like the paths were fine the whole time!
Thanks
the header and cpp file had to have the _U on the end!
and this line was not working,
Adafruit_BMP085 bmp = Adafruit_BMP085(10085);
it needed to be this!!!
Adafruit_BMP085_Unified bmp = Adafruit_BMP085_Unified(10085);
looks like the paths were fine the whole time!
Thanks
- iw2fvo
- Posts: 11
- Joined: Wed Nov 05, 2014 4:15 am
Re: Error message with Adafruit_BMP085 libraries
Good day,
I am not able to compile the sketch and those messages are displayed:
Arduino: 1.0.6 (Windows 7), Board: "Arduino Nano w/ ATmega328"
sketch_nov05a:5: error: 'Adafruit_BMP085' does not name a type
sketch_nov05a.ino: In function 'void setup()':
sketch_nov05a:13: error: 'bmp' was not declared in this scope
sketch_nov05a.ino: In function 'void loop()':
sketch_nov05a:25: error: 'bmp' was not declared in this scope
Any help please ?
Thanks in advance for the assistance
I am not able to compile the sketch and those messages are displayed:
Arduino: 1.0.6 (Windows 7), Board: "Arduino Nano w/ ATmega328"
sketch_nov05a:5: error: 'Adafruit_BMP085' does not name a type
sketch_nov05a.ino: In function 'void setup()':
sketch_nov05a:13: error: 'bmp' was not declared in this scope
sketch_nov05a.ino: In function 'void loop()':
sketch_nov05a:25: error: 'bmp' was not declared in this scope
Any help please ?
Thanks in advance for the assistance
- adafruit_support_bill
- Posts: 89768
- Joined: Sat Feb 07, 2009 10:11 am
Re: Error message with Adafruit_BMP085 libraries
This error message means that the compiler was not able to find the BMP085 library in the expected location. Make sure that is is installed according to the instructions here: http://learn.adafruit.com/adafruit-all- ... nstall-usesketch_nov05a:5: error: 'Adafruit_BMP085' does not name a type
- iw2fvo
- Posts: 11
- Joined: Wed Nov 05, 2014 4:15 am
Re: Error message with Adafruit_BMP085 libraries
I did check several time the published procedure to install the library. I still have same messages.
Could you please post the real structure of the folders and the correct name of the programs and folders too ?
( note that when installed the folders have different name wrt the ones in the procedure ... !! )
Are the drivers to be installed ? ( I did that also).
I would like to operate my bmp180 board using v2 programs ( that i did copy in the IDE ).
Thanks
Ambrogio
Could you please post the real structure of the folders and the correct name of the programs and folders too ?
( note that when installed the folders have different name wrt the ones in the procedure ... !! )
Are the drivers to be installed ? ( I did that also).
I would like to operate my bmp180 board using v2 programs ( that i did copy in the IDE ).
Thanks
Ambrogio
- adafruit_support_bill
- Posts: 89768
- Joined: Sat Feb 07, 2009 10:11 am
Re: Error message with Adafruit_BMP085 libraries
There are 2 versions of the BMP085 library. Make sure that you install the one that matches the example code you are using.
https://github.com/adafruit/Adafruit_BMP085_Unified
https://github.com/adafruit/Adafruit-BMP085-Library
The folder structure should be exactly as it is in Github. You just need to rename the folders to remove the '-' that is added by github.
https://github.com/adafruit/Adafruit_BMP085_Unified
https://github.com/adafruit/Adafruit-BMP085-Library
The folder structure should be exactly as it is in Github. You just need to rename the folders to remove the '-' that is added by github.
- iw2fvo
- Posts: 11
- Joined: Wed Nov 05, 2014 4:15 am
Re: Error message with Adafruit_BMP085 libraries
The following folders are loaded in the required libraries. ( pls : see the attached file ) after un_zipping.
Please : >> what should be the correct "remame" for both of them ?
If i do remove the "-" only, I do not get names equal to what is published: pls let me know exactly.
>> do I have to load the unified sensor too ?
Thanks for the great help on this matter.
Ambrogio
Please : >> what should be the correct "remame" for both of them ?
If i do remove the "-" only, I do not get names equal to what is published: pls let me know exactly.
>> do I have to load the unified sensor too ?
Thanks for the great help on this matter.
Ambrogio
- Attachments
-
- Cattura_01.PNG (18.5 KiB) Viewed 1631 times
- adafruit_support_bill
- Posts: 89768
- Joined: Sat Feb 07, 2009 10:11 am
Re: Error message with Adafruit_BMP085 libraries
The exact folder name does not matter. It just can't have the "-" characters in it. I just change all the "-" to "_".
After you install the library, be sure to exit ALL instances of the IDE and restart the IDE. The IDE wall warn you if one of your folder names is not acceptable.
After you install the library, be sure to exit ALL instances of the IDE and restart the IDE. The IDE wall warn you if one of your folder names is not acceptable.
- iw2fvo
- Posts: 11
- Joined: Wed Nov 05, 2014 4:15 am
Re: Error message with Adafruit_BMP085 libraries
Just to be more clear:
this is what i got after loading the libraries.
Pls : see the attached file.
Thanks
Ambrogio
this is what i got after loading the libraries.
Pls : see the attached file.
Thanks
Ambrogio
- Attachments
-
- Cattura_a0.PNG (178.2 KiB) Viewed 1624 times
- adafruit_support_bill
- Posts: 89768
- Joined: Sat Feb 07, 2009 10:11 am
Re: Error message with Adafruit_BMP085 libraries
You still have all the '-' characters in the folder names.
Change:
"Adafruit-BMP085-Library-master"
to:
"Adafruit_BMP085_Library_master"
And Change:
"Adafruit_Sensor-master"
to:
"Adafruit_Sensor_master"
Change:
"Adafruit-BMP085-Library-master"
to:
"Adafruit_BMP085_Library_master"
And Change:
"Adafruit_Sensor-master"
to:
"Adafruit_Sensor_master"
- iw2fvo
- Posts: 11
- Joined: Wed Nov 05, 2014 4:15 am
Re: Error message with Adafruit_BMP085 libraries
I did as instructed.
I copy/paste the code api v2 in the IDE using copy_code.
I got this message:
Arduino: 1.0.6 (Windows 7), Board: "Arduino Nano w/ ATmega328"
C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=106 -IC:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\variants\eightanaloginputs -IC:\Program Files (x86)\Arduino\libraries\Wire -IC:\Users\Ambrogio\Documents\Arduino\libraries\Adafruit_Sensor_master -IC:\Users\Ambrogio\Documents\Arduino\libraries\Adafruit_BMP085_Library_master C:\Users\Ambrogio\AppData\Local\Temp\build7414351342385994064.tmp\sketch_nov06a.cpp -o C:\Users\Ambrogio\AppData\Local\Temp\build7414351342385994064.tmp\sketch_nov06a.cpp.o
sketch_nov06a:5: error: no matching function for call to 'Adafruit_BMP085::Adafruit_BMP085(int)'
C:\Users\Ambrogio\Documents\Arduino\libraries\Adafruit_BMP085_Library_master/Adafruit_BMP085.h:57: note: candidates are: Adafruit_BMP085::Adafruit_BMP085()
C:\Users\Ambrogio\Documents\Arduino\libraries\Adafruit_BMP085_Library_master/Adafruit_BMP085.h:55: note: Adafruit_BMP085::Adafruit_BMP085(const Adafruit_BMP085&)
sketch_nov06a.ino: In function 'void loop()':
sketch_nov06a:25: error: 'class Adafruit_BMP085' has no member named 'getEvent'
I copy/paste the code api v2 in the IDE using copy_code.
I got this message:
Arduino: 1.0.6 (Windows 7), Board: "Arduino Nano w/ ATmega328"
C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=106 -IC:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\variants\eightanaloginputs -IC:\Program Files (x86)\Arduino\libraries\Wire -IC:\Users\Ambrogio\Documents\Arduino\libraries\Adafruit_Sensor_master -IC:\Users\Ambrogio\Documents\Arduino\libraries\Adafruit_BMP085_Library_master C:\Users\Ambrogio\AppData\Local\Temp\build7414351342385994064.tmp\sketch_nov06a.cpp -o C:\Users\Ambrogio\AppData\Local\Temp\build7414351342385994064.tmp\sketch_nov06a.cpp.o
sketch_nov06a:5: error: no matching function for call to 'Adafruit_BMP085::Adafruit_BMP085(int)'
C:\Users\Ambrogio\Documents\Arduino\libraries\Adafruit_BMP085_Library_master/Adafruit_BMP085.h:57: note: candidates are: Adafruit_BMP085::Adafruit_BMP085()
C:\Users\Ambrogio\Documents\Arduino\libraries\Adafruit_BMP085_Library_master/Adafruit_BMP085.h:55: note: Adafruit_BMP085::Adafruit_BMP085(const Adafruit_BMP085&)
sketch_nov06a.ino: In function 'void loop()':
sketch_nov06a:25: error: 'class Adafruit_BMP085' has no member named 'getEvent'
- adafruit_support_bill
- Posts: 89768
- Joined: Sat Feb 07, 2009 10:11 am
Re: Error message with Adafruit_BMP085 libraries
Please post the code you are trying to compile. Use the '</>' button above the edit window and paste your code between the
Code: Select all
tags.
Please be positive and constructive with your questions and comments.