@@ -191,8 +191,11 @@ def update(self, position, primary, secondary):
191
191
# readings in a FIFO buffer so they can be read later to see a history of
192
192
# recent acceleration. This is handy to look for the maximum/minimum impulse
193
193
# after a click is detected.
194
+ # Define register numbers, which are not exported from the library.
195
+ _REG_CTRL5 = const (0x24 )
196
+ _REG_CLICKSRC = const (0x39 )
194
197
# pylint: disable=protected-access
195
- lis3dh ._write_register_byte (adafruit_lis3dh . REG_CTRL5 , 0b01001000 )
198
+ lis3dh ._write_register_byte (_REG_CTRL5 , 0b01001000 )
196
199
lis3dh ._write_register_byte (0x2E , 0b10000000 ) # Set FIFO_CTRL to Stream mode.
197
200
# pylint: disable=protected-access
198
201
@@ -219,7 +222,7 @@ def update(self, position, primary, secondary):
219
222
# Read the raw click detection register value and check if there was
220
223
# a click detected. Remember only the X axis causes clicks because of
221
224
# the register configuration set previously.
222
- clicksrc = lis3dh ._read_register_byte (adafruit_lis3dh . REG_CLICKSRC ) # pylint: disable=protected-access
225
+ clicksrc = lis3dh ._read_register_byte (_REG_CLICKSRC ) # pylint: disable=protected-access
223
226
if clicksrc & 0b01000000 > 0 :
224
227
# Click was detected! Quickly read 32 values from the accelerometer
225
228
# and look for the maximum magnitude values. Because the
0 commit comments