/ examples / touchscreen_simpletest.py
touchscreen_simpletest.py
 1  import board
 2  import adafruit_touchscreen
 3  
 4  # These pins are used as both analog and digital! XL, XR and YU must be analog
 5  # and digital capable. YD just need to be digital
 6  ts = adafruit_touchscreen.Touchscreen(
 7      board.TOUCH_XL,
 8      board.TOUCH_XR,
 9      board.TOUCH_YD,
10      board.TOUCH_YU,
11      calibration=((5200, 59000), (5800, 57000)),
12      size=(320, 240),
13  )
14  
15  while True:
16      p = ts.touch_point
17      if p:
18          print(p)