Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions adafruit_bme280.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,18 +104,6 @@ def _read_temperature(self):
self._t_fine = int(var1 + var2)
#print("t_fine: ", self.t_fine)

@property
def dew_point(self):
# pylint: disable=invalid-name
# Disable: c is a constant used in the Magnus formula
"""The dew point in Celsius using the Magnus formula. Constants from Sontag, 1990."""
b = 17.62
c = 243.12
gamma = (b * self.temperature /(c + self.temperature)) + math.log(self.humidity / 100.0)
dewpoint = (c * gamma) / (b - gamma)
return dewpoint
# pylint: enable=invalid-name

@property
def temperature(self):
"""The compensated temperature in degrees celsius."""
Expand Down
7 changes: 3 additions & 4 deletions examples/bme280_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
bme280 = adafruit_bme280.Adafruit_BME280_I2C(i2c)

# OR create library object using our Bus SPI port
# spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
# bme_cs = digitalio.DigitalInOut(board.D5)
# bme280 = adafruit_bme280.Adafruit_BME280_SPI(spi, bme_cs)
#spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
#bme_cs = digitalio.DigitalInOut(board.D10)
#bme280 = adafruit_bme280.Adafruit_BME280_SPI(spi, bme_cs)

# change this to match the location's pressure (hPa) at sea level
bme280.sea_level_pressure = 1013.25
Expand All @@ -21,5 +21,4 @@
print("Humidity: %0.1f %%" % bme280.humidity)
print("Pressure: %0.1f hPa" % bme280.pressure)
print("Altitude = %0.2f meters" % bme280.altitude)
print("Dew point = %0.1f C" % bme280.dew_point)
time.sleep(2)