fusion_hat.modules.bmp180 module
- class fusion_hat.modules.bmp180.BMP180(bus: smbus2.SMBus, oversampling=3)[source]
Bases:
objectBMP180 pressure/temperature sensor driver class Used to measure atmospheric pressure and temperature, and can calculate altitude This is a concise implementation version that uses floating-point calculations to improve accuracy
- ADDR = 119
- REG_CAL = 170
- REG_CTRL = 244
- REG_DATA = 246
- CMD_TEMP = 46
- CMD_PRES_BASE = 52
- _readS16(reg)[source]
Read a signed 16-bit integer from the specified register
- Parameters:
reg – register address
- Returns:
converted signed 16-bit integer value
- Return type:
int
- _readU16(reg)[source]
Read an unsigned 16-bit integer from the specified register
- Parameters:
reg – register address
- Returns:
converted unsigned 16-bit integer value
- Return type:
int
- _read_calibration()[source]
Read calibration parameters of the sensor Each BMP180 chip has unique calibration parameters stored in internal EEPROM These parameters are used to compensate for individual differences of the sensor
- _read_raw_temp()[source]
Read raw temperature value Trigger temperature conversion and wait for completion, then read the result
- Returns:
raw temperature value (16-bit unsigned integer)
- Return type:
int