focaltouch_print_touches.py
1 """ 2 Example for getting touch data from an FT6206 or FT6236 capacitive 3 touch driver, over I2C 4 """ 5 6 import time 7 import busio 8 import board 9 import adafruit_focaltouch 10 11 # Create library object (named "ft") using a Bus I2C port 12 i2c = busio.I2C(board.SCL, board.SDA) 13 14 ft = adafruit_focaltouch.Adafruit_FocalTouch(i2c, debug=False) 15 16 while True: 17 # if the screen is being touched print the touches 18 if ft.touched: 19 print(ft.touches) 20 else: 21 print("no touch") 22 23 time.sleep(0.15)