python-bme280/demo.py

13 lines
280 B
Python

#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import bme280
if __name__ == '__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