Skip to content

Commit

Permalink
Merge pull request #26 from adafruit/ladyada-patch-1
Browse files Browse the repository at this point in the history
Update focaltouch_print_touches_with_irq.py
  • Loading branch information
kattni committed Jul 12, 2023
2 parents 12032f7 + 287f9e8 commit 5e4d371
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions examples/focaltouch_print_touches_with_irq.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,16 @@
"""

import time
import busio
import board
from digitalio import DigitalInOut, Direction
import adafruit_focaltouch


if hasattr(
board, "SCL"
): # if SCL and SDA pins are defined by the board definition, use them.
SCL_pin = board.SCL
SDA_pin = board.SDA
else:
SCL_pin = board.IO42 # set to a pin that you want to use for SCL
SDA_pin = board.IO41 # set to a pin that you want to use for SDA

IRQ_pin = board.IO39 # select a pin to connect to the display's interrupt pin ("IRQ")

i2c = busio.I2C(SCL_pin, SDA_pin)
i2c = board.I2C()

# Setup the interrupt (IRQ) pin for input
irq = DigitalInOut(board.IO39)
irq = DigitalInOut(IRQ_pin)
irq.direction = Direction.INPUT

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

0 comments on commit 5e4d371

Please sign in to comment.