/ examples / lps35hw_high_threshold.py
lps35hw_high_threshold.py
 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)