Skip to content

Commit 5e4d371

Browse files
authored
Merge pull request #26 from adafruit/ladyada-patch-1
Update focaltouch_print_touches_with_irq.py
2 parents 12032f7 + 287f9e8 commit 5e4d371

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

examples/focaltouch_print_touches_with_irq.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,16 @@
88
"""
99

1010
import time
11-
import busio
1211
import board
1312
from digitalio import DigitalInOut, Direction
1413
import adafruit_focaltouch
1514

1615

17-
if hasattr(
18-
board, "SCL"
19-
): # if SCL and SDA pins are defined by the board definition, use them.
20-
SCL_pin = board.SCL
21-
SDA_pin = board.SDA
22-
else:
23-
SCL_pin = board.IO42 # set to a pin that you want to use for SCL
24-
SDA_pin = board.IO41 # set to a pin that you want to use for SDA
25-
2616
IRQ_pin = board.IO39 # select a pin to connect to the display's interrupt pin ("IRQ")
27-
28-
i2c = busio.I2C(SCL_pin, SDA_pin)
17+
i2c = board.I2C()
2918

3019
# Setup the interrupt (IRQ) pin for input
31-
irq = DigitalInOut(board.IO39)
20+
irq = DigitalInOut(IRQ_pin)
3221
irq.direction = Direction.INPUT
3322

3423
# Create library object (named "ft") using a Bus I2C port and using an interrupt pin (IRQ)

0 commit comments

Comments
 (0)