Skip to content

Commit 5215d6a

Browse files
committed
pylint and forgot to import const
1 parent e9d9a1e commit 5215d6a

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

examples/spinner.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import adafruit_lis3dh
1717
import neopixel
1818

19+
from micropython import const
1920

2021
# Configuration:
2122
ACCEL_RANGE = adafruit_lis3dh.RANGE_16_G # Accelerometer range.
@@ -71,8 +72,8 @@ def get_position(self, delta):
7172
# AFTER calling set_tap above because the set_tap function also changes
7273
# REG_CTRL5.
7374
# Define register numbers, which are not exported from the library.
74-
_REG_CTRL5 = const(0x24)
75-
_REG_CLICKSRC = const(0x39)
75+
_REG_CTRL5 = const(0x24)
76+
_REG_CLICKSRC = const(0x39)
7677
# pylint: disable=protected-access
7778
lis3dh._write_register_byte(_REG_CTRL5, 0b01001000)
7879
lis3dh._write_register_byte(0x2E, 0b10000000) # Set FIFO_CTRL to Stream mode.

examples/spinner_advanced.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import adafruit_lis3dh
2424
import neopixel
2525

26+
from micropython import const
2627

2728
# Configuration:
2829
ACCEL_RANGE = adafruit_lis3dh.RANGE_16_G # Accelerometer range.
@@ -192,8 +193,8 @@ def update(self, position, primary, secondary):
192193
# recent acceleration. This is handy to look for the maximum/minimum impulse
193194
# after a click is detected.
194195
# Define register numbers, which are not exported from the library.
195-
_REG_CTRL5 = const(0x24)
196-
_REG_CLICKSRC = const(0x39)
196+
_REG_CTRL5 = const(0x24)
197+
_REG_CLICKSRC = const(0x39)
197198
# pylint: disable=protected-access
198199
lis3dh._write_register_byte(_REG_CTRL5, 0b01001000)
199200
lis3dh._write_register_byte(0x2E, 0b10000000) # Set FIFO_CTRL to Stream mode.

0 commit comments

Comments
 (0)