7
7
8
8
SAMPLE_SIZE = 500
9
9
10
+
10
11
class KeyListener :
11
12
"""Object for listening for input in a separate thread"""
13
+
12
14
def __init__ (self ):
13
15
self ._input_key = None
14
16
self ._listener_thread = None
@@ -33,7 +35,7 @@ def stop(self):
33
35
34
36
@property
35
37
def pressed (self ):
36
- "Return whether enter was pressed since last checked" ""
38
+ "Return whether enter was pressed since last checked" ""
37
39
result = False
38
40
if self ._input_key is not None :
39
41
self ._input_key = None
@@ -42,17 +44,17 @@ def pressed(self):
42
44
43
45
44
46
def main ():
47
+ # pylint: disable=too-many-locals, too-many-statements
45
48
i2c = busio .I2C (board .SCL , board .SDA )
46
49
47
50
gyro_accel = LSM6DSOX (i2c )
48
51
magnetometer = LIS3MDL (i2c )
49
52
key_listener = KeyListener ()
50
53
key_listener .start ()
51
54
52
-
53
- """
54
- Magnetometer Calibration
55
- """
55
+ ############################
56
+ # Magnetometer Calibration #
57
+ ############################
56
58
57
59
print ("Magnetometer Calibration" )
58
60
print ("Start moving the board in all directions" )
@@ -112,9 +114,9 @@ def main():
112
114
)
113
115
)
114
116
115
- """
116
- Gyroscope Calibration
117
- """
117
+ #########################
118
+ # Gyroscope Calibration #
119
+ #########################
118
120
119
121
gyro_x , gyro_y , gyro_z = gyro_accel .gyro
120
122
min_x = max_x = gyro_x
0 commit comments