Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 920 Bytes

README.md

File metadata and controls

31 lines (24 loc) · 920 Bytes

FWAP

Farkas Weather Analysis for raspberry Pi

This code fetches data from MPL3115A2 and Si7021 breakout boards, both built by Adafruit.

The MPL3115A2 library is more or less a copy of the Adafruit CircuitPython MPL3115A2 library, but written using smbus2 so that it can run on Linux.

Example

To read from the MPL3115A2 chip:

from MPL3115A2 import MPL3115A2

chip = MPL3115A2(1)
print("-----")
print("🗻  Altitude is %.3f" % chip.altitude)
print("🌬  Pressure is %.2f" % chip.pressure)
temp = chip.temperature
print("🌡  Temp is %.3f°C (%.3f°F)" % (temp, (temp * 1.8 + 32.0)))
print("-----")

Output

-----
🗻  Altitude is 36.438
🌬  Pressure is 101764.50
🌡  Temp is 18.500°C (65.300°F)
-----