@@ -191,8 +191,11 @@ def update(self, position, primary, secondary):
191191# readings in a FIFO buffer so they can be read later to see a history of
192192# recent acceleration. This is handy to look for the maximum/minimum impulse
193193# 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 )
194197# pylint: disable=protected-access
195- lis3dh ._write_register_byte (adafruit_lis3dh . REG_CTRL5 , 0b01001000 )
198+ lis3dh ._write_register_byte (_REG_CTRL5 , 0b01001000 )
196199lis3dh ._write_register_byte (0x2E , 0b10000000 ) # Set FIFO_CTRL to Stream mode.
197200# pylint: disable=protected-access
198201
@@ -219,7 +222,7 @@ def update(self, position, primary, secondary):
219222 # Read the raw click detection register value and check if there was
220223 # a click detected. Remember only the X axis causes clicks because of
221224 # 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
223226 if clicksrc & 0b01000000 > 0 :
224227 # Click was detected! Quickly read 32 values from the accelerometer
225228 # and look for the maximum magnitude values. Because the
0 commit comments