Skip to content

Commit dca6636

Browse files
committed
also linting examples :|
1 parent db71e72 commit dca6636

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

examples/lis331_high_pass_filter.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
import time
22
import board
33
import busio
4-
from adafruit_lis331 import *
4+
import adafruit_lis331
55

66
i2c = busio.I2C(board.SCL, board.SDA)
77
# un-comment the sensor you are using
88
# lis = H3LIS331(i2c)
9-
lis = LIS331HH(i2c)
9+
lis = adafruit_lis331.LIS331HH(i2c)
1010

1111
# use a nice fast data rate to for maximum resolution
12-
lis.data_rate = Rate.RATE_1000_HZ
12+
lis.data_rate = adafruit_lis331.Rate.RATE_1000_HZ
1313

1414
# enable the high pass filter without a reference or offset
15-
lis.enable_hpf(True, cutoff=RateDivisor.ODR_DIV_100, use_reference=False)
15+
lis.enable_hpf(
16+
True, cutoff=adafruit_lis331.RateDivisor.ODR_DIV_100, use_reference=False
17+
)
1618

1719
# you can also uncomment this section to set and use a reference to offset the measurements
1820
# lis.hpf_reference = 50

examples/lis331_low_pass_filter.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import time
22
import board
33
import busio
4-
from adafruit_lis331 import *
4+
from adafruit_lis331 import LIS331HH, Rate, Frequency
55

66
i2c = busio.I2C(board.SCL, board.SDA)
77

@@ -11,11 +11,13 @@
1111

1212
# `data_rate` must be a `LOWPOWER` rate to use the low-pass filter
1313
lis.data_rate = Rate.RATE_LOWPOWER_10_HZ
14-
# next set the cutoff frequency. Anything changing faster than the specified frequency will be filtered out
14+
# next set the cutoff frequency. Anything changing faster than
15+
# the specified frequency will be filtered out
1516
lis.lpf_cutoff = Frequency.FREQ_74_HZ
1617

17-
# Once you've seen the filter do its thing, you can comment out the lines above to use the default data rate
18-
# without the low pass filter and see the difference it makes
18+
# Once you've seen the filter do its thing, you can comment out the
19+
# lines above to use the default data rate without the low pass filter
20+
# and see the difference it makes
1921

2022
while True:
2123
print(lis.acceleration) # plotter friendly printing

0 commit comments

Comments
 (0)