Skip to content

Commit

Permalink
Merge pull request #9 from jarzebski/dev
Browse files Browse the repository at this point in the history
release 1.1.0
  • Loading branch information
jarzebski authored May 18, 2023
2 parents 83820e6 + 7d00532 commit 7cb1c00
Show file tree
Hide file tree
Showing 10 changed files with 130 additions and 709 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
MS5611 Arduino Library 1.1.0 / 19.05.2023
======================================================================

* Fix hangs if temperature is lower than 20
* Add PlatformIO and Arduino library informations
* Change to MIT license
* General cleanups

MS5611 Arduino Library 1.0.0 / 14.05.2014
======================================================================

Expand Down
695 changes: 21 additions & 674 deletions LICENSE

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
File renamed without changes.
31 changes: 31 additions & 0 deletions keywords.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
###########################################
# Syntax Coloring Map For MS5611
###########################################

###########################################
# Datatypes (KEYWORD1)
###########################################

MS5611 KEYWORD1

###########################################
# Methods and Functions (KEYWORD2)
###########################################
begin KEYWORD2
readRawTemperature KEYWORD2
readRawPressure KEYWORD2
readTemperature KEYWORD2
readPressure KEYWORD2
getAltitude KEYWORD2
getSeaLevel KEYWORD2
setOversampling KEYWORD2
getOversampling KEYWORD2

###########################################
# Constants (LITERAL1)
###########################################
MS5611_ULTRA_HIGH_RES LITERAL1
MS5611_HIGH_RES LITERAL1
MS5611_STANDARD LITERAL1
MS5611_LOW_POWER LITERAL1
MS5611_ULTRA_LOW_POWER LITERAL1
16 changes: 16 additions & 0 deletions library.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "Arduino-MS5611",
"keywords": "MS5611, pressure, temperature, i2c",
"description": "MS5611 Barometric Pressure & Temperature Sensor Arduino Library",
"repository": {
"type": "git",
"url": "https://github.com/jarzebski/Arduino-MS5611"
},
"authors": {
"name": "Korneliusz Jarzębski",
"url": "https://www.jarzebski.pl"
},
"version": "1.1.0",
"frameworks": "arduino",
"platforms": "*"
}
11 changes: 11 additions & 0 deletions library.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name=MS5611 Arduino Library
version=1.1.0
author=Korneliusz Jarzębski
maintainer=Korneliusz Jarzębski
sentence=MS5611 Barometric Pressure & Temperature Sensor Arduino Library
paragraph=
category=Sensors
url=https://github.com/jarzebski/Arduino-MS5611
architectures=*
includes=MS5611.h
depends=
46 changes: 24 additions & 22 deletions MS5611.cpp → src/MS5611.cpp
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
/*
MS5611.cpp - Class file for the MS5611 Barometric Pressure & Temperature Sensor Arduino Library.
Version: 1.0.0
(c) 2014 Korneliusz Jarzebski
www.jarzebski.pl
The MIT License
This program is free software: you can redistribute it and/or modify
it under the terms of the version 3 GNU General Public License as
published by the Free Software Foundation.
Copyright (c) 2014-2023 Korneliusz Jarzębski
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#if ARDUINO >= 100
Expand Down Expand Up @@ -181,7 +187,7 @@ double MS5611::readTemperature(bool compensation)
{
if (TEMP < 2000)
{
TEMP2 = (dT * dT) / (2 << 30);
TEMP2 = (dT * dT) / pow(2, 31);
}
}

Expand Down Expand Up @@ -214,17 +220,15 @@ uint16_t MS5611::readRegister16(uint8_t reg)
#endif
Wire.endTransmission();

Wire.beginTransmission(MS5611_ADDRESS);
Wire.requestFrom(MS5611_ADDRESS, 2);
while(!Wire.available()) {};

#if ARDUINO >= 100
uint8_t vha = Wire.read();
uint8_t vla = Wire.read();
#else
uint8_t vha = Wire.receive();
uint8_t vla = Wire.receive();
#endif;
Wire.endTransmission();
#endif

value = vha << 8 | vla;

Expand All @@ -243,9 +247,8 @@ uint32_t MS5611::readRegister24(uint8_t reg)
#endif
Wire.endTransmission();

Wire.beginTransmission(MS5611_ADDRESS);
Wire.requestFrom(MS5611_ADDRESS, 3);
while(!Wire.available()) {};

#if ARDUINO >= 100
uint8_t vxa = Wire.read();
uint8_t vha = Wire.read();
Expand All @@ -254,8 +257,7 @@ uint32_t MS5611::readRegister24(uint8_t reg)
uint8_t vxa = Wire.receive();
uint8_t vha = Wire.receive();
uint8_t vla = Wire.receive();
#endif;
Wire.endTransmission();
#endif

value = ((int32_t)vxa << 16) | ((int32_t)vha << 8) | vla;

Expand Down
32 changes: 19 additions & 13 deletions MS5611.h → src/MS5611.h
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
/*
MS5611.h - Header file for the MS5611 Barometric Pressure & Temperature Sensor Arduino Library.
Version: 1.0.0
(c) 2014 Korneliusz Jarzebski
www.jarzebski.pl
The MIT License
This program is free software: you can redistribute it and/or modify
it under the terms of the version 3 GNU General Public License as
published by the Free Software Foundation.
Copyright (c) 2014-2023 Korneliusz Jarzębski
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef MS5611_h
Expand Down

0 comments on commit 7cb1c00

Please sign in to comment.