File tree 5 files changed +74
-72
lines changed
5 files changed +74
-72
lines changed Original file line number Diff line number Diff line change 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 )
Original file line number Diff line number Diff line change 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 )
Original file line number Diff line number Diff line change 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 )
Original file line number Diff line number Diff line change 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 )
Original file line number Diff line number Diff line change
1
+ import time
1
2
import board
2
3
import adafruit_lps35hw
3
- import time
4
4
5
5
i2c = board .I2C ()
6
6
lps = adafruit_lps35hw .LPS35HW (i2c )
You can’t perform that action at this time.
0 commit comments