## BMP180 sensor Read values from a BMP180 sensor and dump them to the serial port. For connection details [refer here](/programming/i2c) ![Screenshot](../images/ide/bmpconn.jpeg) The code !!! tip "examples/C/BMP180_UART_DEMO.c" ```c /* Scan the I2C bus and send results via UART. */ #include // Include file for I/O operations #define REG_CONTROL 0xF4 #define CMD_TEMP 0x2E #define REG_RESULT 0xF6 int main (void) { uint8_t addresses[20], found,temp_cmd[]={REG_CONTROL, CMD_TEMP}, res[10]={0,0,0,0,0,0,0,0,0,0},i=0; i2c_init(); uart_init(38400); for(;;) { found = i2c_scan(&addresses[0]); // i2c scan will store the addresses in `addresses`, and return total found sensors. for(i=0;iIn [2]: (116<<8) + 196 Out[2]: 29892 In [3]: rawt= (116<<8) + 196 In [4]: a = 0.00482444*(rawt - 20636) In [5]: a Out[5]: 44.65501664 In [6]: a+(-942/(a+16.506)) Out[6]: 29.253048985591825