A python library for accessing the BME280 combined humidity and pressure sensor from Bosch
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

17 lines
285 B

  1. #!/usr/bin/env python
  2. import bme280
  3. def main():
  4. bme = bme280.Bme280()
  5. bme.set_mode(bme280.MODE_FORCED)
  6. t, p, h = bme.get_data()
  7. print("Temperature: %f °C" % t)
  8. print("Pressure: %f P" % p)
  9. print("Humidity: %f %%" % h)
  10. if __name__ == '__main__':
  11. main()