├── .github ├── ISSUE_TEMPLATE.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ └── githubci.yml ├── .gitignore ├── Adafruit_MPL115A2.cpp ├── Adafruit_MPL115A2.h ├── README.md ├── assets └── board.jpg ├── code-of-conduct.md ├── examples ├── getPT │ └── getPT.ino └── getpressure │ └── getpressure.ino ├── library.properties └── license.txt /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Thank you for opening an issue on an Adafruit Arduino library repository. To 2 | improve the speed of resolution please review the following guidelines and 3 | common troubleshooting steps below before creating the issue: 4 | 5 | - **Do not use GitHub issues for troubleshooting projects and issues.** Instead use 6 | the forums at http://forums.adafruit.com to ask questions and troubleshoot why 7 | something isn't working as expected. In many cases the problem is a common issue 8 | that you will more quickly receive help from the forum community. GitHub issues 9 | are meant for known defects in the code. If you don't know if there is a defect 10 | in the code then start with troubleshooting on the forum first. 11 | 12 | - **If following a tutorial or guide be sure you didn't miss a step.** Carefully 13 | check all of the steps and commands to run have been followed. Consult the 14 | forum if you're unsure or have questions about steps in a guide/tutorial. 15 | 16 | - **For Arduino projects check these very common issues to ensure they don't apply**: 17 | 18 | - For uploading sketches or communicating with the board make sure you're using 19 | a **USB data cable** and **not** a **USB charge-only cable**. It is sometimes 20 | very hard to tell the difference between a data and charge cable! Try using the 21 | cable with other devices or swapping to another cable to confirm it is not 22 | the problem. 23 | 24 | - **Be sure you are supplying adequate power to the board.** Check the specs of 25 | your board and plug in an external power supply. In many cases just 26 | plugging a board into your computer is not enough to power it and other 27 | peripherals. 28 | 29 | - **Double check all soldering joints and connections.** Flakey connections 30 | cause many mysterious problems. See the [guide to excellent soldering](https://learn.adafruit.com/adafruit-guide-excellent-soldering/tools) for examples of good solder joints. 31 | 32 | - **Ensure you are using an official Arduino or Adafruit board.** We can't 33 | guarantee a clone board will have the same functionality and work as expected 34 | with this code and don't support them. 35 | 36 | If you're sure this issue is a defect in the code and checked the steps above 37 | please fill in the following fields to provide enough troubleshooting information. 38 | You may delete the guideline and text above to just leave the following details: 39 | 40 | - Arduino board: **INSERT ARDUINO BOARD NAME/TYPE HERE** 41 | 42 | - Arduino IDE version (found in Arduino -> About Arduino menu): **INSERT ARDUINO 43 | VERSION HERE** 44 | 45 | - List the steps to reproduce the problem below (if possible attach a sketch or 46 | copy the sketch code in too): **LIST REPRO STEPS BELOW** 47 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Thank you for creating a pull request to contribute to Adafruit's GitHub code! 2 | Before you open the request please review the following guidelines and tips to 3 | help it be more easily integrated: 4 | 5 | - **Describe the scope of your change--i.e. what the change does and what parts 6 | of the code were modified.** This will help us understand any risks of integrating 7 | the code. 8 | 9 | - **Describe any known limitations with your change.** For example if the change 10 | doesn't apply to a supported platform of the library please mention it. 11 | 12 | - **Please run any tests or examples that can exercise your modified code.** We 13 | strive to not break users of the code and running tests/examples helps with this 14 | process. 15 | 16 | Thank you again for contributing! We will try to test and integrate the change 17 | as soon as we can, but be aware we have many GitHub repositories to manage and 18 | can't immediately respond to every request. There is no need to bump or check in 19 | on a pull request (it will clutter the discussion of the request). 20 | 21 | Also don't be worried if the request is closed or not integrated--sometimes the 22 | priorities of Adafruit's GitHub code (education, ease of use) might not match the 23 | priorities of the pull request. Don't fret, the open source community thrives on 24 | forks and GitHub makes it easy to keep your changes in a forked repo. 25 | 26 | After reviewing the guidelines above you can delete this text from the pull request. 27 | -------------------------------------------------------------------------------- /.github/workflows/githubci.yml: -------------------------------------------------------------------------------- 1 | name: Arduino Library CI 2 | 3 | on: [pull_request, push, repository_dispatch] 4 | 5 | jobs: 6 | build: 7 | runs-on: ubuntu-latest 8 | 9 | steps: 10 | - uses: actions/setup-python@v4 11 | with: 12 | python-version: '3.x' 13 | - uses: actions/checkout@v3 14 | - uses: actions/checkout@v3 15 | with: 16 | repository: adafruit/ci-arduino 17 | path: ci 18 | 19 | - name: pre-install 20 | run: bash ci/actions_install.sh 21 | 22 | - name: test platforms 23 | run: python3 ci/build_platform.py main_platforms 24 | 25 | - name: clang 26 | run: python3 ci/run-clang-format.py -e "ci/*" -e "bin/*" -r . 27 | 28 | - name: doxygen 29 | env: 30 | GH_REPO_TOKEN: ${{ secrets.GH_REPO_TOKEN }} 31 | PRETTYNAME : "Adafruit MPL115A2 Library" 32 | run: bash ci/doxy_gen_and_deploy.sh 33 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # osx 2 | .DS_Store 3 | 4 | # doxygen 5 | Doxyfile* 6 | doxygen_sqlite3.db 7 | html 8 | *.tmp 9 | -------------------------------------------------------------------------------- /Adafruit_MPL115A2.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * @file Adafruit_MPL115A2.cpp 3 | * 4 | * @mainpage Driver for the Adafruit MPL115A2 barometric pressure sensor 5 | * 6 | * @section intro_sec Introduction 7 | * 8 | * Driver for the MPL115A2 barometric pressure sensor 9 | * 10 | * This is a library for the Adafruit MPL115A2 breakout 11 | * ----> https://www.adafruit.com/products/992 12 | * 13 | * Adafruit invests time and resources providing this open source code, 14 | * please support Adafruit and open-source hardware by purchasing 15 | * products from Adafruit! 16 | * 17 | * @section author Author 18 | * 19 | * K.Townsend (Adafruit Industries) 20 | * 21 | * @section license License 22 | * 23 | * BSD (see license.txt) 24 | * 25 | * @section history 26 | * 27 | * v1.0 - First release 28 | * v1.1 - Rick Sellens added casts to make bit shifts work below 22.6C 29 | * - get both P and T with a single call to getPT 30 | */ 31 | 32 | #include "Adafruit_MPL115A2.h" 33 | 34 | /*! 35 | * @brief Gets the factory-set coefficients for this particular sensor 36 | */ 37 | void Adafruit_MPL115A2::readCoefficients() { 38 | int16_t a0coeff; 39 | int16_t b1coeff; 40 | int16_t b2coeff; 41 | int16_t c12coeff; 42 | 43 | uint8_t cmd; 44 | uint8_t buffer[8]; 45 | 46 | cmd = MPL115A2_REGISTER_A0_COEFF_MSB; 47 | _i2c_dev->write_then_read(&cmd, 1, buffer, 8); 48 | 49 | a0coeff = (((uint16_t)buffer[0] << 8) | buffer[1]); 50 | b1coeff = (((uint16_t)buffer[2] << 8) | buffer[3]); 51 | b2coeff = (((uint16_t)buffer[4] << 8) | buffer[5]); 52 | c12coeff = (((uint16_t)buffer[6] << 8) | buffer[7]) >> 2; 53 | 54 | /* 55 | Serial.print("A0 = "); Serial.println(a0coeff, HEX); 56 | Serial.print("B1 = "); Serial.println(b1coeff, HEX); 57 | Serial.print("B2 = "); Serial.println(b2coeff, HEX); 58 | Serial.print("C12 = "); Serial.println(c12coeff, HEX); 59 | */ 60 | 61 | _mpl115a2_a0 = (float)a0coeff / 8; 62 | _mpl115a2_b1 = (float)b1coeff / 8192; 63 | _mpl115a2_b2 = (float)b2coeff / 16384; 64 | _mpl115a2_c12 = (float)c12coeff; 65 | _mpl115a2_c12 /= 4194304.0; 66 | 67 | /* 68 | Serial.print("a0 = "); Serial.println(_mpl115a2_a0); 69 | Serial.print("b1 = "); Serial.println(_mpl115a2_b1); 70 | Serial.print("b2 = "); Serial.println(_mpl115a2_b2); 71 | Serial.print("c12 = "); Serial.println(_mpl115a2_c12); 72 | */ 73 | } 74 | 75 | /*! 76 | * @brief Instantiates a new MPL115A2 class 77 | */ 78 | Adafruit_MPL115A2::Adafruit_MPL115A2() { 79 | _mpl115a2_a0 = 0.0F; 80 | _mpl115a2_b1 = 0.0F; 81 | _mpl115a2_b2 = 0.0F; 82 | _mpl115a2_c12 = 0.0F; 83 | } 84 | 85 | /*! 86 | * @brief Setups the HW (reads coefficients values, etc.) 87 | * @return Returns true if the device was found 88 | */ 89 | bool Adafruit_MPL115A2::begin() { 90 | return begin(MPL115A2_DEFAULT_ADDRESS, &Wire); 91 | } 92 | 93 | /*! 94 | * @brief Setups the HW (reads coefficients values, etc.) 95 | * @param *theWire 96 | * @return Returns true if the device was found 97 | */ 98 | bool Adafruit_MPL115A2::begin(TwoWire *theWire) { 99 | return begin(MPL115A2_DEFAULT_ADDRESS, theWire); 100 | } 101 | 102 | /*! 103 | * @brief Setups the HW (reads coefficients values, etc.) 104 | * @param addr 105 | * @return Returns true if the device was found 106 | */ 107 | bool Adafruit_MPL115A2::begin(uint8_t addr) { return begin(addr, &Wire); } 108 | 109 | /*! 110 | * @brief Setups the HW (reads coefficients values, etc.) 111 | * @param addr 112 | * @param *theWire 113 | * @return Returns true if the device was found 114 | */ 115 | bool Adafruit_MPL115A2::begin(uint8_t addr, TwoWire *theWire) { 116 | if (_i2c_dev) { 117 | delete _i2c_dev; 118 | } 119 | _i2c_dev = new Adafruit_I2CDevice(addr, theWire); 120 | 121 | if (!_i2c_dev->begin()) { 122 | return false; 123 | } 124 | 125 | // Read factory coefficient values (this only needs to be done once) 126 | readCoefficients(); 127 | return true; 128 | } 129 | 130 | /*! 131 | * @brief Gets the floating-point pressure level in kPa 132 | * @return Pressure in kPa 133 | */ 134 | float Adafruit_MPL115A2::getPressure() { 135 | float pressureComp, centigrade; 136 | 137 | getPT(&pressureComp, ¢igrade); 138 | return pressureComp; 139 | } 140 | 141 | /*! 142 | * @brief Gets the floating-point temperature in Centigrade 143 | * @return Temperature in Centigrade 144 | */ 145 | float Adafruit_MPL115A2::getTemperature() { 146 | float pressureComp, centigrade; 147 | 148 | getPT(&pressureComp, ¢igrade); 149 | return centigrade; 150 | } 151 | 152 | /*! 153 | * @brief Gets both at once and saves a little time 154 | * @param *P 155 | * Pointer to pressure value 156 | * @param *T 157 | * Pointer to temperature value 158 | */ 159 | void Adafruit_MPL115A2::getPT(float *P, float *T) { 160 | uint16_t pressure, temp; 161 | float pressureComp; 162 | 163 | uint8_t cmd[2] = {MPL115A2_REGISTER_STARTCONVERSION, 0}; 164 | uint8_t buffer[4]; 165 | 166 | _i2c_dev->write(cmd, 2); 167 | 168 | // Wait a bit for the conversion to complete (3ms max) 169 | delay(5); 170 | 171 | cmd[0] = MPL115A2_REGISTER_PRESSURE_MSB; 172 | _i2c_dev->write_then_read(cmd, 1, buffer, 4); 173 | 174 | pressure = (((uint16_t)buffer[0] << 8) | buffer[1]) >> 6; 175 | temp = (((uint16_t)buffer[2] << 8) | buffer[3]) >> 6; 176 | 177 | // See datasheet p.6 for evaluation sequence 178 | pressureComp = _mpl115a2_a0 + 179 | (_mpl115a2_b1 + _mpl115a2_c12 * temp) * pressure + 180 | _mpl115a2_b2 * temp; 181 | 182 | // Return pressure and temperature as floating point values 183 | *P = ((65.0F / 1023.0F) * pressureComp) + 50.0F; // kPa 184 | *T = ((float)temp - 498.0F) / -5.35F + 25.0F; // C 185 | } 186 | -------------------------------------------------------------------------------- /Adafruit_MPL115A2.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * @file Adafruit_MPL115A2.h 3 | */ 4 | 5 | #ifndef _ADAFRUIT_MPL115A2_H 6 | #define _ADAFRUIT_MPL115A2_H 7 | 8 | #include "Arduino.h" 9 | #include 10 | #include 11 | 12 | #define MPL115A2_DEFAULT_ADDRESS (0x60) /**< I2C address **/ 13 | 14 | #define MPL115A2_REGISTER_PRESSURE_MSB \ 15 | (0x00) /**< 10-bit Pressure ADC output value MSB **/ 16 | #define MPL115A2_REGISTER_PRESSURE_LSB \ 17 | (0x01) /**< 10-bit Pressure ADC output value LSB **/ 18 | #define MPL115A2_REGISTER_TEMP_MSB \ 19 | (0x02) /**< 10-bit Temperature ADC output value MSB **/ 20 | #define MPL115A2_REGISTER_TEMP_LSB \ 21 | (0x03) /**< 10-bit Temperature ADC output value LSB **/ 22 | #define MPL115A2_REGISTER_A0_COEFF_MSB (0x04) /**< a0 coefficient MSB **/ 23 | #define MPL115A2_REGISTER_A0_COEFF_LSB (0x05) /**< a0 coefficient LSB **/ 24 | #define MPL115A2_REGISTER_B1_COEFF_MSB (0x06) /**< b1 coefficient MSB **/ 25 | #define MPL115A2_REGISTER_B1_COEFF_LSB (0x07) /**< b1 coefficient LSB **/ 26 | #define MPL115A2_REGISTER_B2_COEFF_MSB (0x08) /**< b2 coefficient MSB **/ 27 | #define MPL115A2_REGISTER_B2_COEFF_LSB (0x09) /**< b2 coefficient LSB **/ 28 | #define MPL115A2_REGISTER_C12_COEFF_MSB (0x0A) /**< c12 coefficient MSB **/ 29 | #define MPL115A2_REGISTER_C12_COEFF_LSB (0x0B) /**< c12 coefficient LSB **/ 30 | #define MPL115A2_REGISTER_STARTCONVERSION \ 31 | (0x12) /**< Start Pressure and Temperature Conversion **/ 32 | 33 | /*! 34 | * @brief Class that stores state and functions for interacting with 35 | * MPL115A2 barometric pressure sensor 36 | */ 37 | class Adafruit_MPL115A2 { 38 | public: 39 | Adafruit_MPL115A2(); 40 | bool begin(); 41 | bool begin(TwoWire *theWire); 42 | bool begin(uint8_t addr); 43 | bool begin(uint8_t addr, TwoWire *theWire); 44 | 45 | float getPressure(); 46 | float getTemperature(); 47 | void getPT(float *P, float *T); 48 | 49 | private: 50 | Adafruit_I2CDevice *_i2c_dev = NULL; 51 | 52 | float _mpl115a2_a0; 53 | float _mpl115a2_b1; 54 | float _mpl115a2_b2; 55 | float _mpl115a2_c12; 56 | 57 | void readCoefficients(); 58 | }; 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Adafruit MPL115A2 Library[![Build Status](https://github.com/adafruit/Adafruit_MPL115A2/workflows/Arduino%20Library%20CI/badge.svg)](https://github.com/adafruit/Adafruit_MPL115A2/actions)[![Documentation](https://github.com/adafruit/ci-arduino/blob/master/assets/doxygen_badge.svg)](http://adafruit.github.io/Adafruit_MPL115A2/html/index.html) 2 | 3 | 4 | 5 | Driver for the Adafruit MPL115A2 barometric pressure sensor breakout. 6 | 7 | To install, use the Arduino Library Manager and search for 'Adafruit MPL115A2' and install the library. 8 | 9 | -------------------------------------------------------------------------------- /assets/board.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_MPL115A2/0cbecc86371846d60aa79cb45485182ef43e1ddb/assets/board.jpg -------------------------------------------------------------------------------- /code-of-conduct.md: -------------------------------------------------------------------------------- 1 | # Adafruit Community Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and leaders pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, gender identity and expression, level or type of 9 | experience, education, socio-economic status, nationality, personal appearance, 10 | race, religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | We are committed to providing a friendly, safe and welcoming environment for 15 | all. 16 | 17 | Examples of behavior that contributes to creating a positive environment 18 | include: 19 | 20 | * Be kind and courteous to others 21 | * Using welcoming and inclusive language 22 | * Being respectful of differing viewpoints and experiences 23 | * Collaborating with other community members 24 | * Gracefully accepting constructive criticism 25 | * Focusing on what is best for the community 26 | * Showing empathy towards other community members 27 | 28 | Examples of unacceptable behavior by participants include: 29 | 30 | * The use of sexualized language or imagery and sexual attention or advances 31 | * The use of inappropriate images, including in a community member's avatar 32 | * The use of inappropriate language, including in a community member's nickname 33 | * Any spamming, flaming, baiting or other attention-stealing behavior 34 | * Excessive or unwelcome helping; answering outside the scope of the question 35 | asked 36 | * Trolling, insulting/derogatory comments, and personal or political attacks 37 | * Public or private harassment 38 | * Publishing others' private information, such as a physical or electronic 39 | address, without explicit permission 40 | * Other conduct which could reasonably be considered inappropriate 41 | 42 | The goal of the standards and moderation guidelines outlined here is to build 43 | and maintain a respectful community. We ask that you don’t just aim to be 44 | "technically unimpeachable", but rather try to be your best self. 45 | 46 | We value many things beyond technical expertise, including collaboration and 47 | supporting others within our community. Providing a positive experience for 48 | other community members can have a much more significant impact than simply 49 | providing the correct answer. 50 | 51 | ## Our Responsibilities 52 | 53 | Project leaders are responsible for clarifying the standards of acceptable 54 | behavior and are expected to take appropriate and fair corrective action in 55 | response to any instances of unacceptable behavior. 56 | 57 | Project leaders have the right and responsibility to remove, edit, or 58 | reject messages, comments, commits, code, issues, and other contributions 59 | that are not aligned to this Code of Conduct, or to ban temporarily or 60 | permanently any community member for other behaviors that they deem 61 | inappropriate, threatening, offensive, or harmful. 62 | 63 | ## Moderation 64 | 65 | Instances of behaviors that violate the Adafruit Community Code of Conduct 66 | may be reported by any member of the community. Community members are 67 | encouraged to report these situations, including situations they witness 68 | involving other community members. 69 | 70 | You may report in the following ways: 71 | 72 | In any situation, you may send an email to . 73 | 74 | On the Adafruit Discord, you may send an open message from any channel 75 | to all Community Helpers by tagging @community helpers. You may also send an 76 | open message from any channel, or a direct message to @kattni#1507, 77 | @tannewt#4653, @Dan Halbert#1614, @cater#2442, @sommersoft#0222, or 78 | @Andon#8175. 79 | 80 | Email and direct message reports will be kept confidential. 81 | 82 | In situations on Discord where the issue is particularly egregious, possibly 83 | illegal, requires immediate action, or violates the Discord terms of service, 84 | you should also report the message directly to Discord. 85 | 86 | These are the steps for upholding our community’s standards of conduct. 87 | 88 | 1. Any member of the community may report any situation that violates the 89 | Adafruit Community Code of Conduct. All reports will be reviewed and 90 | investigated. 91 | 2. If the behavior is an egregious violation, the community member who 92 | committed the violation may be banned immediately, without warning. 93 | 3. Otherwise, moderators will first respond to such behavior with a warning. 94 | 4. Moderators follow a soft "three strikes" policy - the community member may 95 | be given another chance, if they are receptive to the warning and change their 96 | behavior. 97 | 5. If the community member is unreceptive or unreasonable when warned by a 98 | moderator, or the warning goes unheeded, they may be banned for a first or 99 | second offense. Repeated offenses will result in the community member being 100 | banned. 101 | 102 | ## Scope 103 | 104 | This Code of Conduct and the enforcement policies listed above apply to all 105 | Adafruit Community venues. This includes but is not limited to any community 106 | spaces (both public and private), the entire Adafruit Discord server, and 107 | Adafruit GitHub repositories. Examples of Adafruit Community spaces include 108 | but are not limited to meet-ups, audio chats on the Adafruit Discord, or 109 | interaction at a conference. 110 | 111 | This Code of Conduct applies both within project spaces and in public spaces 112 | when an individual is representing the project or its community. As a community 113 | member, you are representing our community, and are expected to behave 114 | accordingly. 115 | 116 | ## Attribution 117 | 118 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 119 | version 1.4, available at 120 | , 121 | and the [Rust Code of Conduct](https://www.rust-lang.org/en-US/conduct.html). 122 | 123 | For other projects adopting the Adafruit Community Code of 124 | Conduct, please contact the maintainers of those projects for enforcement. 125 | If you wish to use this code of conduct for your own project, consider 126 | explicitly mentioning your moderation policy or making a copy with your 127 | own moderation policy so as to avoid confusion. 128 | -------------------------------------------------------------------------------- /examples/getPT/getPT.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | Adafruit_MPL115A2 mpl115a2; 5 | 6 | void setup(void) 7 | { 8 | Serial.begin(9600); 9 | Serial.println("Hello!"); 10 | 11 | Serial.println("Getting barometric pressure ..."); 12 | if (! mpl115a2.begin()) { 13 | Serial.println("Sensor not found! Check wiring"); 14 | while (1); 15 | } 16 | } 17 | 18 | void loop(void) 19 | { 20 | float pressureKPA = 0, temperatureC = 0; 21 | 22 | mpl115a2.getPT(&pressureKPA,&temperatureC); 23 | Serial.print("Pressure (kPa): "); Serial.print(pressureKPA, 4); Serial.print(" kPa "); 24 | Serial.print("Temp (*C): "); Serial.print(temperatureC, 1); Serial.println(" *C both measured together"); 25 | 26 | pressureKPA = mpl115a2.getPressure(); 27 | Serial.print("Pressure (kPa): "); Serial.print(pressureKPA, 4); Serial.println(" kPa"); 28 | 29 | temperatureC = mpl115a2.getTemperature(); 30 | Serial.print("Temp (*C): "); Serial.print(temperatureC, 1); Serial.println(" *C"); 31 | 32 | delay(1000); 33 | } 34 | -------------------------------------------------------------------------------- /examples/getpressure/getpressure.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | Adafruit_MPL115A2 mpl115a2; 5 | 6 | void setup(void) 7 | { 8 | Serial.begin(9600); 9 | Serial.println("Hello!"); 10 | 11 | Serial.println("Getting barometric pressure ..."); 12 | if (! mpl115a2.begin()) { 13 | Serial.println("Sensor not found! Check wiring"); 14 | while (1); 15 | } 16 | } 17 | 18 | void loop(void) 19 | { 20 | float pressureKPA = 0, temperatureC = 0; 21 | 22 | pressureKPA = mpl115a2.getPressure(); 23 | Serial.print("Pressure (kPa): "); Serial.print(pressureKPA, 4); Serial.println(" kPa"); 24 | 25 | temperatureC = mpl115a2.getTemperature(); 26 | Serial.print("Temp (*C): "); Serial.print(temperatureC, 1); Serial.println(" *C"); 27 | 28 | delay(1000); 29 | } 30 | -------------------------------------------------------------------------------- /library.properties: -------------------------------------------------------------------------------- 1 | name=Adafruit MPL115A2 2 | version=2.0.2 3 | author=Adafruit 4 | maintainer=Adafruit 5 | sentence=Driver for the Adafruit MPL115A2 barometric pressure sensor breakout 6 | paragraph=Driver for the Adafruit MPL115A2 barometric pressure sensor breakout 7 | category=Sensors 8 | url=https://github.com/adafruit/Adafruit_MPL115A2 9 | architectures=* 10 | depends=Adafruit BusIO 11 | -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | Software License Agreement (BSD License) 2 | 3 | Copyright (c) 2012, Adafruit Industries 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 1. Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | 2. Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | 3. Neither the name of the copyright holders nor the 14 | names of its contributors may be used to endorse or promote products 15 | derived from this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 18 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 21 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------------