Skip to content

Commit 0ff3515

Browse files
committed
whippin' out the lint roller
1 parent 499c17b commit 0ff3515

5 files changed

+74
-72
lines changed

examples/lps35hw_data_rate.py

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
import board
2-
from adafruit_lps35hw import LPS35HW, DataRate
3-
import time
4-
5-
i2c = board.I2C()
6-
lps = LPS35HW(i2c)
7-
8-
lps.data_rate = DataRate.ONE_SHOT
9-
lps.take_measurement()
10-
11-
12-
while True:
13-
print("Pressure: %.2f hPa" % lps.pressure)
14-
print("")
15-
time.sleep(1)
16-
print("Pressure: %.2f hPa" % lps.pressure)
17-
print("")
18-
time.sleep(1)
19-
print("Pressure: %.2f hPa" % lps.pressure)
20-
print("")
21-
time.sleep(1)
22-
23-
#take another measurement
24-
lps.take_measurement()
25-
26-
print("New Pressure: %.2f hPa" % lps.pressure)
27-
print("")
28-
time.sleep(1)
1+
import time
2+
import board
3+
from adafruit_lps35hw import LPS35HW, DataRate
4+
5+
i2c = board.I2C()
6+
lps = LPS35HW(i2c)
7+
8+
lps.data_rate = DataRate.ONE_SHOT
9+
lps.take_measurement()
10+
11+
12+
while True:
13+
print("Pressure: %.2f hPa" % lps.pressure)
14+
print("")
15+
time.sleep(1)
16+
print("Pressure: %.2f hPa" % lps.pressure)
17+
print("")
18+
time.sleep(1)
19+
print("Pressure: %.2f hPa" % lps.pressure)
20+
print("")
21+
time.sleep(1)
22+
23+
#take another measurement
24+
lps.take_measurement()
25+
26+
print("New Pressure: %.2f hPa" % lps.pressure)
27+
print("")
28+
time.sleep(1)

examples/lps35hw_filter.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
import board
2-
import adafruit_lps35hw
3-
import time
4-
5-
i2c = board.I2C()
6-
lps = adafruit_lps35hw.LPS35HW(i2c)
7-
8-
lps.low_pass_enabled = True
9-
while True:
10-
print("Pressure: %.2f hPa" % lps.pressure)
11-
print("")
12-
time.sleep(0.125)
1+
import time
2+
import board
3+
import adafruit_lps35hw
4+
5+
6+
i2c = board.I2C()
7+
lps = adafruit_lps35hw.LPS35HW(i2c)
8+
9+
lps.low_pass_enabled = True
10+
while True:
11+
print("Pressure: %.2f hPa" % lps.pressure)
12+
print("")
13+
time.sleep(0.125)

examples/lps35hw_high_threshold.py

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
import board
2-
import adafruit_lps35hw
3-
import time
4-
i2c = board.I2C()
5-
lps = adafruit_lps35hw.LPS35HW(i2c)
6-
7-
# You may need to adjust the threshold to something closer
8-
# to the current pressure where the sensor is
9-
lps.pressure_threshold = 1030
10-
11-
lps.high_threshold_enabled = True
12-
13-
while True:
14-
print("Pressure: %.2f hPa" % lps.pressure)
15-
print("Threshhold exceeded: %s" % lps.high_threshold_exceeded)
16-
print("")
17-
time.sleep(1)
1+
import time
2+
import board
3+
import adafruit_lps35hw
4+
5+
i2c = board.I2C()
6+
lps = adafruit_lps35hw.LPS35HW(i2c)
7+
8+
# You may need to adjust the threshold to something closer
9+
# to the current pressure where the sensor is
10+
lps.pressure_threshold = 1030
11+
12+
lps.high_threshold_enabled = True
13+
14+
while True:
15+
print("Pressure: %.2f hPa" % lps.pressure)
16+
print("Threshhold exceeded: %s" % lps.high_threshold_exceeded)
17+
print("")
18+
time.sleep(1)

examples/lps35hw_relative.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import board
2-
import adafruit_lps35hw
3-
import time
4-
5-
i2c = board.I2C()
6-
lps = adafruit_lps35hw.LPS35HW(i2c)
7-
8-
# set the current pressure as zero hPa and make measurements
9-
# relative to that pressure, even negative!
10-
lps.zero_pressure()
11-
while True:
12-
print("Pressure: %.2f hPa" % lps.pressure)
13-
print("")
14-
time.sleep(0.5)
1+
import time
2+
import board
3+
import adafruit_lps35hw
4+
5+
i2c = board.I2C()
6+
lps = adafruit_lps35hw.LPS35HW(i2c)
7+
8+
# set the current pressure as zero hPa and make measurements
9+
# relative to that pressure, even negative!
10+
lps.zero_pressure()
11+
while True:
12+
print("Pressure: %.2f hPa" % lps.pressure)
13+
print("")
14+
time.sleep(0.5)

examples/lps35hw_simpletest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import time
12
import board
23
import adafruit_lps35hw
3-
import time
44

55
i2c = board.I2C()
66
lps = adafruit_lps35hw.LPS35HW(i2c)

0 commit comments

Comments
 (0)