Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

RubenT17/ms5607

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

4 Commits

Repository files navigation

MS5607

Library for MS5607 altimeter sensor

https://www.parallax.com/product/altimeter-module-ms5607/

✒️ Author

⚙️ How to use

#include "ms5607.h"
typedef struct
{
	uint16_t calibration[5];
	float temp;
	float pressure;
	float altitude;
} altimeter_t;
altimeter_t altimeter = {0};
/**
 * Read calibration from MS5607 altimeter
 * @return HAL status
 */
inline HAL_StatusTypeDef aocs_config_altimeter()
{
	HAL_StatusTypeDef err = ms5607_reset();
	if (err != HAL_OK)	return err;
	HAL_Delay(10);
	err = ms5607_readCalibration(altimeter.calibration);
	if (err != HAL_OK)	return err;
	return HAL_OK;
}
/**
 * Get altitude, pressure and temperature from MS5607 altimeter
 * @return HAL status
 */
inline HAL_StatusTypeDef aocs_get_altimeter()
{
	if(ms5607_getTempPressure(MS5607_ADC_4096, altimeter.calibration, &altimeter.temp, &altimeter.pressure) != HAL_OK)	return HAL_ERROR;
	altimeter.altitude = ms5607_getAltitude(altimeter.pressure);
	return HAL_OK;
}

📄 License

This project is licensed under the General Public License - see the LICENSE.md file for details

❓ Where to ask questions

Type Platforms
🚨 Bug Reports GitHub Issue Tracker
🎁 Feature Requests & Ideas GitHub Issue Tracker

About

MS5607 altimeter sensor

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

AltStyle によって変換されたページ (->オリジナル) /