edu.udayton.udri.asset.raspi.bmp180/src/edu/udayton/udri/asset/raspi/bmp180/Bmp180Sensor.java
private long readPressure() throws IOException, InterruptedException
    {   
        final byte[] bytesPress = new byte[PRESSURE_DATA_SIZE];
        
        m_Bmp180.write(CONTROL_REGISTER, (byte)(PRESSURE_WRITE_START + (m_SamplingSetting << SIX_BIT_SHIFT)));
        Thread.sleep(m_SleepTime);
            
        m_Bmp180.read(MSB_ADDR, bytesPress, 0, PRESSURE_DATA_SIZE);
        
        final DataInputStream bmp180In = new DataInputStream(new ByteArrayInputStream(bytesPress));
        
        final long msb = bmp180In.read();
        final long lsb = bmp180In.read();
        final long xlsb = bmp180In.read();
        
        bmp180In.close();
        
        final long UP = ((msb << SIXTEEN_BIT_SHIFT) + (lsb << EIGHT_BIT_SHIFT) + xlsb) 
                >> (EIGHT_BIT_SHIFT - m_SamplingSetting);
        
        return UP;
    }
/**
     * Reads the uncompensated pressure from the BMP180 sensor.
     * 
     * @return long the uncompensated pressure
     * @throws IOException when failing to read a byte either from across i2c or from the data stream
     * @throws InterruptedException when failing to sleep
     */
Reads the uncompensated pressure from the BMP180 sensor.

@return long the uncompensated pressure
@throws IOException when failing to read a byte either from across i2c or from the data stream
@throws InterruptedException when failing to sleep
Reads the uncompensated pressure from the BMP180 sensor . @return long the uncompensated pressure @throws IOException when failing to read a byte either from across i2c or from the data stream @throws InterruptedException when failing to sleep
private long readPressure() throws IOException, InterruptedException
    {   
        final byte[] bytesPress = new byte[PRESSURE_DATA_SIZE];
        m_Bmp180.write(CONTROL_REGISTER, (byte)(PRESSURE_WRITE_START + (m_SamplingSetting << SIX_BIT_SHIFT)));
        Thread.sleep(m_SleepTime);
        m_Bmp180.read(MSB_ADDR, bytesPress, 0, PRESSURE_DATA_SIZE);
        final DataInputStream bmp180In = new DataInputStream(new ByteArrayInputStream(bytesPress));
        final long msb = bmp180In.read();
        final long lsb = bmp180In.read();
        final long xlsb = bmp180In.read();
        bmp180In.close();
        final long UP = ((msb << SIXTEEN_BIT_SHIFT) + (lsb << EIGHT_BIT_SHIFT) + xlsb) 
                >> (EIGHT_BIT_SHIFT - m_SamplingSetting);
        return UP;
    }
private long readPressure ( ) throws IOException , InterruptedException { final byte [ ] bytesPress = new byte [ PRESSURE_DATA_SIZE ] ; m_Bmp180 . write ( CONTROL_REGISTER , ( byte ) ( PRESSURE_WRITE_START + ( m_SamplingSetting << SIX_BIT_SHIFT ) ) ) ; Thread . sleep ( m_SleepTime ) ; m_Bmp180 . read ( MSB_ADDR , bytesPress , 0 , PRESSURE_DATA_SIZE ) ; final DataInputStream bmp180In = new DataInputStream ( new ByteArrayInputStream ( bytesPress ) ) ; final long msb = bmp180In . read ( ) ; final long lsb = bmp180In . read ( ) ; final long xlsb = bmp180In . read ( ) ; bmp180In . close ( ) ; final long UP = ( ( msb << SIXTEEN_BIT_SHIFT ) + ( lsb << EIGHT_BIT_SHIFT ) + xlsb ) >> ( EIGHT_BIT_SHIFT - m_SamplingSetting ) ; return UP ; }
Reads the uncompensated pressure from the BMP180 sensor.
Reads the uncompensated pressure from the BMP180 sensor .