Skip to content

Commit 403cee3

Browse files
authored
Merge pull request #13 from adafruit/revert-12-add-dew-point
Revert "Added dew point, updated example"
2 parents ac1bc89 + 6a9d4e7 commit 403cee3

File tree

2 files changed

+3
-16
lines changed

2 files changed

+3
-16
lines changed

adafruit_bme280.py

-12
Original file line numberDiff line numberDiff line change
@@ -104,18 +104,6 @@ def _read_temperature(self):
104104
self._t_fine = int(var1 + var2)
105105
#print("t_fine: ", self.t_fine)
106106

107-
@property
108-
def dew_point(self):
109-
# pylint: disable=invalid-name
110-
# Disable: c is a constant used in the Magnus formula
111-
"""The dew point in Celsius using the Magnus formula. Constants from Sontag, 1990."""
112-
b = 17.62
113-
c = 243.12
114-
gamma = (b * self.temperature /(c + self.temperature)) + math.log(self.humidity / 100.0)
115-
dewpoint = (c * gamma) / (b - gamma)
116-
return dewpoint
117-
# pylint: enable=invalid-name
118-
119107
@property
120108
def temperature(self):
121109
"""The compensated temperature in degrees celsius."""

examples/bme280_simpletest.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
bme280 = adafruit_bme280.Adafruit_BME280_I2C(i2c)
1010

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

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

0 commit comments

Comments
 (0)