![background image](http://html1.mh-extra.com/html/omron/d6f-ph/d6f-ph_user-manual_740809027.webp)
D6F-PH MEMS Differential pressure Sensor User’s Manual (A288)
26
char send1[] = {0x0B, 0x00};
I2C_WR(SA_7, send1, 2);
}
/*=======================================================*/
/* Pressure measure Function */
/* Usage : Press_meas( void ) */
/* Argument : NULL */
/* Return value : Compensated Pressure value(unsigned) */
/*=======================================================*/
short Press_meas(void)
{
short rd_fifo;
short rd_flow;
unsigned long wait_time;
/* [D040] <= 06h */
char send2[] = {0x00, 0xD0, 0x40, 0x18, 0x06};
I2C_WR(SA_7, send2, 5);
wait_time = 33; /*33msec wait */
/* wait time depend on resolution mode */
adc_wait(wait_time);
/* [D051/D052] => Read Compensated Flow value */
char send3[] = {0x00, 0xD0, 0x51, 0x2C, 0x07};
uRD_FIFO = I2C_RD_u16(SA_7, send3, 5);
// Press Mode : [Pa] = (xx[count] - 1024) * Full Range [Pa]/ 60000 - Full Range [Pa] at
other
if (RANGE_MODE == 250) {
rd_flow = ((rd_fifo - 1024) * RANGE_MODE *10/ 60000); /* convert to [Pa] */
}
else {
rd_flow = ((rd_fifo - 1024) * RANGE_MODE *10/ 60000) - RANGE_MODE*10/2; /* convert
to [Pa] */
}
return rd_flow;
}
/*=======================================================*/
/* Temperature measure Function */
/* Usage : Temp_meas() */
/* Argument : NULL */
/* Return value : x10 Temperature */
/*=======================================================*/