i just purchased "Arduino Uno R3 (Atmega328 - assembled)[ID:50] = $29.95" to interface with 1 x MPL115A2 - I2C Barometric Pressure/Temperature Sensor[ID:992] = $11.95
is this right interface board? how about the test code?
Please let me know
MPL115A2
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_mike
- Posts: 67446
- Joined: Thu Feb 11, 2010 2:51 pm
Re: MPL115A2
We don't have a full-scale tutorial for that yet, but the 'Tutorials' tab of the product page has the information you need to get running: http://www.adafruit.com/products/992#Tutorials
It also has a link to the driver library: https://github.com/adafruit/Adafruit_MPL115A2
It also has a link to the driver library: https://github.com/adafruit/Adafruit_MPL115A2
-
- Posts: 9
- Joined: Tue Oct 22, 2013 7:07 pm
Re: MPL115A2
#include <Wire.h>
#include <Adafruit_MPL115A2.h>
Adafruit_MPL115A2 mpl115a2;
void setup(void)
{
Serial.begin(9600);
Serial.println("Hello!");
Serial.println("Getting barometric pressure ...");
mpl115a2.begin();
}
void loop(void)
{
float pressureKPA = 0, temperatureC = 0;
mpl115a2.getPT(&pressureKPA,&temperatureC);
Serial.print("Pressure (kPa): "); Serial.print(pressureKPA, 4); Serial.print(" kPa ");
Serial.print("Temp (*C): "); Serial.print(temperatureC, 1); Serial.println(" *C both measured together");
pressureKPA = mpl115a2.getPressure();
Serial.print("Pressure (kPa): "); Serial.print(pressureKPA, 4); Serial.println(" kPa");
temperatureC = mpl115a2.getTemperature();
Serial.print("Temp (*C): "); Serial.print(temperatureC, 1); Serial.println(" *C");
delay(1000);
}
I see the following error message, please help
getPT:4: error: 'Adafruit_MPL115A2' does not name a type
getPT.ino: In function 'void setup()':
getPT:12: error: 'mpl115a2' was not declared in this scope
getPT.ino: In function 'void loop()':
getPT:19: error: 'mpl115a2' was not declared in this scope
#include <Adafruit_MPL115A2.h>
Adafruit_MPL115A2 mpl115a2;
void setup(void)
{
Serial.begin(9600);
Serial.println("Hello!");
Serial.println("Getting barometric pressure ...");
mpl115a2.begin();
}
void loop(void)
{
float pressureKPA = 0, temperatureC = 0;
mpl115a2.getPT(&pressureKPA,&temperatureC);
Serial.print("Pressure (kPa): "); Serial.print(pressureKPA, 4); Serial.print(" kPa ");
Serial.print("Temp (*C): "); Serial.print(temperatureC, 1); Serial.println(" *C both measured together");
pressureKPA = mpl115a2.getPressure();
Serial.print("Pressure (kPa): "); Serial.print(pressureKPA, 4); Serial.println(" kPa");
temperatureC = mpl115a2.getTemperature();
Serial.print("Temp (*C): "); Serial.print(temperatureC, 1); Serial.println(" *C");
delay(1000);
}
I see the following error message, please help
getPT:4: error: 'Adafruit_MPL115A2' does not name a type
getPT.ino: In function 'void setup()':
getPT:12: error: 'mpl115a2' was not declared in this scope
getPT.ino: In function 'void loop()':
getPT:19: error: 'mpl115a2' was not declared in this scope
-
- Posts: 9
- Joined: Tue Oct 22, 2013 7:07 pm
Re: MPL115A2
Hi adafruit_support_mike:
Can you please post correct (updated) library to get pressure readings of MPL115A2?
The code posted above did not work,
Thanks in advance,
Can you please post correct (updated) library to get pressure readings of MPL115A2?
The code posted above did not work,
Thanks in advance,
- adafruit_support_mike
- Posts: 67446
- Joined: Thu Feb 11, 2010 2:51 pm
Re: MPL115A2
Those errors occur when the Arduino IDE can't find the library files.
You need to have a folder in your sketchbook named 'libraries', and the library you downloaded from Github needs to live in a folder within that. This tutorial has more details: http://learn.adafruit.com/adafruit-all- ... nstall-use
You need to have a folder in your sketchbook named 'libraries', and the library you downloaded from Github needs to live in a folder within that. This tutorial has more details: http://learn.adafruit.com/adafruit-all- ... nstall-use
-
- Posts: 9
- Joined: Tue Oct 22, 2013 7:07 pm
Re: MPL115A2
Hi adafruit_support_mike:
The code starts like this with header file residing in correct foler:
#include <Wire.h>
#include <Adafruit_MPL115A2.h>
Adafruit_MPL115A2 mpl115a2 // no declaration/definition from the associated codes at all;
void loop(void)
{
float pressureKPA = 0, temperatureC = 0;
mpl115a2.getPT(&pressureKPA,&temperatureC);
However, error pop-up as below after uploading.
It is not related to location of libray file.
Can you please look into this?
I purchased the board since i thought library file works, but no it does not seem to work,
please help
getPT:4: error: 'Adafruit_MPL115A2' does not name a type
getPT.ino: In function 'void setup()':
getPT:12: error: 'mpl115a2' was not declared in this scope
The code starts like this with header file residing in correct foler:
#include <Wire.h>
#include <Adafruit_MPL115A2.h>
Adafruit_MPL115A2 mpl115a2 // no declaration/definition from the associated codes at all;
void loop(void)
{
float pressureKPA = 0, temperatureC = 0;
mpl115a2.getPT(&pressureKPA,&temperatureC);
However, error pop-up as below after uploading.
It is not related to location of libray file.
Can you please look into this?
I purchased the board since i thought library file works, but no it does not seem to work,
please help
getPT:4: error: 'Adafruit_MPL115A2' does not name a type
getPT.ino: In function 'void setup()':
getPT:12: error: 'mpl115a2' was not declared in this scope
-
- Posts: 9
- Joined: Tue Oct 22, 2013 7:07 pm
Re: MPL115A2
Hi Mike from adafruit_support:
Last edited by kdm1903 on Thu Oct 24, 2013 2:51 am, edited 1 time in total.
- adafruit_support_bill
- Posts: 88088
- Joined: Sat Feb 07, 2009 10:11 am
Re: MPL115A2
All the files are there. Please read through this tutorial and make sure you have them installed in the correct location. http://learn.adafruit.com/adafruit-all- ... nstall-use
-
- Posts: 9
- Joined: Tue Oct 22, 2013 7:07 pm
Re: MPL115A2
Is there an way to save the output data SHOWN IN SERIAL MONITOR to a text file IN VOID LOOP ? I am hoping to write sensor data to a text file,
PLEASE LET ME KNOW
PLEASE LET ME KNOW
- adafruit_support_bill
- Posts: 88088
- Joined: Sat Feb 07, 2009 10:11 am
Re: MPL115A2
To save data directly from the Arduino, you would need an SD card adapter like this one: http://www.adafruit.com/products/254
You can write to a file on the SD card just like you write to the serial port.
To save data shown in the serial monitor on your PC, just cut and paste into an editor like notepad and save to a file.
You can write to a file on the SD card just like you write to the serial port.
To save data shown in the serial monitor on your PC, just cut and paste into an editor like notepad and save to a file.
-
- Posts: 9
- Joined: Tue Oct 22, 2013 7:07 pm
Re: MPL115A2
Thanks for letting me know, but i was wondering if i can use any command to create txt file that can be saved into PC,
since test will take about 7 days and data will overflow the serial monitor screen,
please advise,
Thanks
since test will take about 7 days and data will overflow the serial monitor screen,
please advise,
Thanks
- adafruit_support_mike
- Posts: 67446
- Joined: Thu Feb 11, 2010 2:51 pm
Re: MPL115A2
I don't think the Arduino IDE has the capacity to open and save files in the user filesystem. It's main purpose is to be a programming and debugging environment.
The Processing environment can create files though: http://processing.org/
Processing and the Arduino IDE are both built on the same framework (Wiring), so a Processing sketch should be able to collect the data and write it to a file.
The Processing environment can create files though: http://processing.org/
Processing and the Arduino IDE are both built on the same framework (Wiring), so a Processing sketch should be able to collect the data and write it to a file.
-
- Posts: 9
- Joined: Tue Oct 22, 2013 7:07 pm
Re: MPL115A2
http://www.adafruit.com/products/992
can I get a electrical schematic of the board for MPL115A2 - I2C Barometric Pressure/Temperature Sensor?
It looks like passive components (Caps/Resitors) are mounted on the board.
Please let me know
can I get a electrical schematic of the board for MPL115A2 - I2C Barometric Pressure/Temperature Sensor?
It looks like passive components (Caps/Resitors) are mounted on the board.
Please let me know
- adafruit_support_mike
- Posts: 67446
- Joined: Thu Feb 11, 2010 2:51 pm
Re: MPL115A2
We don't seem to have design files for that board on Github, but the basic design can be found on page 2 of the datasheet: http://www.adafruit.com/datasheets/MPL115A2.pdf
Looks like both capacitors are 1uF, and the photo on the product page shows all the resistors are 10k with 5% tolerances. Two of the resitors are weak pull-ups for the I2C channels, and the other two are pull-ups for the shutdown and reset pins.
Looks like both capacitors are 1uF, and the photo on the product page shows all the resistors are 10k with 5% tolerances. Two of the resitors are weak pull-ups for the I2C channels, and the other two are pull-ups for the shutdown and reset pins.
Please be positive and constructive with your questions and comments.