1
0
mirror of https://github.com/cmur2/python-bme280.git synced 2024-12-22 22:54:23 +01:00
python-bme280/demo.py

13 lines
280 B
Python
Raw Normal View History

2018-03-14 22:52:10 +01:00
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
2016-05-30 22:13:05 +02:00
import bme280
if __name__ == '__main__':
2018-03-14 22:52:10 +01:00
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