adafruit_tsc2007

Python library for TSC2007 resistive touch screen driver

  • Author(s): ladyada

Implementation Notes

Hardware:

Software and Dependencies:

class adafruit_tsc2007.TSC2007(i2c: I2C, address: int = 72, irq: int | None = None, invert_x: bool = False, invert_y: bool = False, swap_xy: bool = False)

A driver for the TSC2007 resistive touch sensor.

command(function: int, power: int, resolution: int) int

Write a command byte to the TSC2007 and read the 2-byte response

property invert_x: bool

Whether the X axis is inverted

property invert_y: bool

Whether the Y axis is inverted

property swap_xy: bool

Whether the X and Y axes are swapped

property touch: dict

Returns the current touch point

property touched: bool

Returns whether the panel is touched. If irq pin is set, uses the pin value. If not, the TSC2007 is polled and pressure is checked