已知气压,温度,求当前高度的公式。
通过该公式,实现的C语言代码:
float BMP_Temperature,BMP_Pressure,Altitude;
while(BMP280_GetStatus(BMP280_MEASURING) != false);
while(BMP280_GetStatus(BMP280_IM_UPDATE) != false);
BMP_Temperature = BMP280_Get_Temperature();
BMP_Pressure = BMP280_Get_Pressure();
printf("温度:%.2f C 压强:%.2f Pa\r\n",BMP_Temperature,BMP_Pressure);
Altitude = ((powf((101325.0f/BMP_Pressure),(1/5.257f))-1) * (BMP_Temperature+273.15f)) / 0.0065f;
printf("高度:%.4fcm\r\n",Altitude);
标签:Pressure,%.,Temperature,BMP280,Altitude,已知,BMP,气压,温度
From: https://www.cnblogs.com/songmingze/p/17884099.html