Skip to content

Commit 5383e4a

Browse files
committed
Fixed pylint errors
1 parent 83facdf commit 5383e4a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

examples/mcp230xx_event_detect_interrupt.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
from time import sleep
2+
13
import board
24
import busio
5+
from digitalio import Direction, Pull
36
from RPi import GPIO
4-
from digitalio import DigitalInOut, Direction, Pull
57
from adafruit_mcp230xx.mcp23017 import MCP23017
6-
from time import sleep
78

89
# Initialize the I2C bus:
910
i2c = busio.I2C(board.SCL, board.SDA)
@@ -20,7 +21,7 @@
2021
for pin in range(0, 16):
2122
pins.append(mcp.get_pin(pin))
2223

23-
# Set all the pins to input
24+
# Set all the pins to input
2425
for pin in pins:
2526
pin.direction = Direction.INPUT
2627
pin.pull = Pull.UP
@@ -40,10 +41,9 @@
4041

4142
def print_interrupt(port):
4243
'''Callback function to be called when an Interrupt occurs.'''
43-
flga = mcp.int_flaga
44-
flgb = mcp.int_flagb
45-
for pin in mcp.int_flag:
46-
print("Pin number: {} changed to: {}".format(pin, pins[pin].value ))
44+
for pin_flag in mcp.int_flag:
45+
print("Interrupt connected to Pin: {}".format(port))
46+
print("Pin number: {} changed to: {}".format(pin_flag, pins[pin_flag].value))
4747
mcp.clear_ints()
4848

4949
# connect either interrupt pin to the Raspberry pi's pin 17.

0 commit comments

Comments
 (0)