Skip to content

Commit ba340a2

Browse files
committed
pylint
1 parent 351d487 commit ba340a2

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

examples/joywing_gamepad.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,19 @@
88
from adafruit_hid.gamepad import Gamepad
99
from micropython import const
1010

11-
def range_map(x, in_min, in_max, out_min, out_max):
12-
return (x - in_min) * (out_max - out_min) // (in_max - in_min) + out_min
11+
def range_map(value, in_min, in_max, out_min, out_max):
12+
return (value - in_min) * (out_max - out_min) // (in_max - in_min) + out_min
1313

1414
BUTTON_RIGHT = const(6)
15-
BUTTON_DOWN = const(7)
16-
BUTTON_LEFT = const(9)
17-
BUTTON_UP = const(10)
18-
BUTTON_SEL = const(14)
19-
button_mask = const( (1 << BUTTON_RIGHT) | (1 << BUTTON_DOWN) | (1 << BUTTON_LEFT) | (1 << BUTTON_UP) | (1 << BUTTON_SEL) )
15+
BUTTON_DOWN = const(7)
16+
BUTTON_LEFT = const(9)
17+
BUTTON_UP = const(10)
18+
BUTTON_SEL = const(14)
19+
button_mask = const((1 << BUTTON_RIGHT) |
20+
(1 << BUTTON_DOWN) |
21+
(1 << BUTTON_LEFT) |
22+
(1 << BUTTON_UP) |
23+
(1 << BUTTON_SEL))
2024

2125
i2c = busio.I2C(board.SCL, board.SDA)
2226

0 commit comments

Comments
 (0)