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.
 
 

16 lines
285 B

#!/usr/bin/env python
import bme280
def main():
bme = bme280.Bme280()
bme.set_mode(bme280.MODE_FORCED)
t, p, h = bme.get_data()
print("Temperature: %f °C" % t)
print("Pressure: %f P" % p)
print("Humidity: %f %%" % h)
if __name__ == '__main__':
main()