bmp180读到的气压值是自身校准过的还是得自己校准
发布网友
发布时间:2022-04-26 23:56
我来回答
共1个回答
热心网友
时间:2022-04-27 01:34
自己校准,按手册操作。
X1 = ((UT-AC6)*AC5)>>15;
X2 = ((long)MC<<11)/(X1+MD);
B5 = X1+X2;
T = (B5+8)>>4;
*t_p_v =T/10.0;
B6 = B5-4000;
X1 = (B2*B6*B6)>>23;
X2 = (AC2*B6)>>11;
X3 = X1+X2;
B3 = (((long)AC1*4+X3)+2)/4;
X1 = (AC3*B6)>>13;
X2 = (B1*(B6*B6>>12))>>16;
X3 = ((X1+X2)+2)>>2;
B4 = AC4*(unsigned long)(X3+32768)>>15;
B7 = ((unsigned long)UP-B3)*50000;
if (B7 < 0x80000000)
{
P = (B7*2)/B4;
}
else
P=(B7/B4)*2;
X1 = (P/256.0)*(P/256.0);
X1 = (X1*3038)>>16;
X2 = (-7357*P)>>16;
P = P+((X1+X2+3791)>>4);
t_p_v++;
*t_p_v = P;
t_p_v++;
*t_p_v = 44330*(1-pow((P/101325.0),(1.0/5.255)));