项目作者: feyzikesim

项目描述 :
BMP280 Digital Pressure Sensor Driver for Python3
高级语言: Python
项目地址: git://github.com/feyzikesim/bmp280.git
创建时间: 2019-12-24T11:28:34Z
项目社区:https://github.com/feyzikesim/bmp280

开源协议:MIT License

下载


BMP280 Digital Pressure Sensor Driver for Python3

BMP280 is a digital pressure sensor manufactured by Bosch Sensortec. With this driver, you can use BMP280 with Python3 over I2C.

Dependencies

Only smbus2 other than Python.

Installation

  1. pip3 install bmp-280

Usage

  1. run-bmp280

or

  1. from bmp_280 import BMP280
  2. from time import sleep
  3. bmp = BMP280(port=1, mode=BMP280.FORCED_MODE, oversampling_p=BMP280.OVERSAMPLING_P_x16, oversampling_t=BMP280.OVERSAMPLING_T_x1,
  4. filter=BMP280.IIR_FILTER_OFF, standby=BMP280.T_STANDBY_1000)
  5. pressure = bmp.read_pressure()
  6. temp = bmp.read_temperature()
  7. print("Pressure (hPa): " + str(pressure))
  8. print("Temperature (°C): " + str(temp))

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT