Skip to content

Commit c63d245

Browse files
committed
fix pylint issues
1 parent 1f6bf6b commit c63d245

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

examples/lis2mdl_calibrate.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# calibration for magnetometer X (min, max), Y and Z
1212
hardiron_calibration = [[1000, -1000], [1000, -1000], [1000, -1000]]
1313

14+
1415
def calibrate():
1516
start_time = time.monotonic()
1617

@@ -24,6 +25,7 @@ def calibrate():
2425
print("Calibration complete:")
2526
print("hardiron_calibration =", hardiron_calibration)
2627

28+
2729
print("Prepare to calibrate! Twist the magnetometer around in 3D in...")
2830
print("3...")
2931
time.sleep(1)

examples/lis2mdl_compass.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@
1313
# these values are in uT and are in X, Y, Z order (min and max values)
1414
hardiron_calibration = [[-61.4879, 34.4782], [-43.6714, 53.5662], [-40.7337, 52.4554]]
1515

16+
1617
# This will take the magnetometer values, adjust them with the calibraitons
1718
# and return a new array with the XYZ values ranging from -100 to 100
18-
def normalize(magvals):
19+
def normalize(_magvals):
1920
ret = [0, 0, 0]
20-
for i, axis in enumerate(magvals):
21+
for i, axis in enumerate(_magvals):
2122
minv, maxv = hardiron_calibration[i]
2223
axis = min(max(minv, axis), maxv) # keep within min/max calibration
2324
ret[i] =(axis - minv) * 200 / (maxv - minv) + -100
@@ -36,4 +37,4 @@ def normalize(magvals):
3637
compass_heading += 180
3738

3839
print("Heading:", compass_heading)
39-
time.sleep(0.1)
40+
time.sleep(0.1)

0 commit comments

Comments
 (0)