:
7de9f4d5fd982160b24068e052b44c84_785.png (0 Bytes, 下载次数: 5)
2010-12-14 22:54 上传
[mw_shl_code=c,true]//??????????
void BMP180_GetPressure(void)
{
u8 buffer[2];
double temp1,temp2,temp3;
//?ò?????????÷????0X34??????4.5ms,?????????????÷??AD??
//?ò?????????÷??????????????,?????±??????,???±??????????????????????????
// 0X34 4.5ms 16??????
// 0x74 7.5 17??????
// 0xb4 13.5 18??????
// 0xf4 25.5 19??????
BMP180_I2C1WriteByte(BMP180_REG_CTRL_MEAS,0X34);
delay_ms(5);
BMP180_I2C2ReadData(BMP180_REG_OUT_MSB,buffer,2);
delay_ms(5);
UP = buffer[0]<<8 | buffer[1];
B6 = B5-4000;
X1 = (B2*(B6*B6>>12))>>11;
X2 = AC2*B6>>11;
X3 = X1+X2;
B3 = ((AC1&l