ft5x06 — Touch Screen Driver#

The ft5x06 module provides a driver for the FT5x06 capacitive touch screen controller used on the OpenMV Pure Thermal.

class FT5X06 – Touch Screen Controller#

class ft5x06.FT5X06(i2c_addr: int = 0x38)#

Creates a touch screen controller object.

i2c_addr is the I2C address of the FT5x06 controller.

get_gesture() int#

Returns the current gesture. The return value is one of the ft5x06.GESTURE_* constants.

When a callback is registered via FT5X06.touch_callback() this method should only be called from within the callback.

get_points() int#

Returns the current number of touch points (0-5).

When a callback is registered via FT5X06.touch_callback() this method should only be called from within the callback.

get_point_flag(index: int) int#

Returns the current state of the touch point at index (0-4). The return value is one of the ft5x06.FLAG_* constants.

When a callback is registered via FT5X06.touch_callback() this method should only be called from within the callback.

get_point_id(index: int) int#

Returns the id of the touch point at index (0-4). The id is a numeric value that allows tracking a touch point across updates as points are added and removed.

When a callback is registered via FT5X06.touch_callback() this method should only be called from within the callback.

get_point_x(index: int) int#

Returns the x pixel position of the touch point at index (0-4).

When a callback is registered via FT5X06.touch_callback() this method should only be called from within the callback.

get_point_y(index: int) int#

Returns the y pixel position of the touch point at index (0-4).

When a callback is registered via FT5X06.touch_callback() this method should only be called from within the callback.

touch_callback(callback: object) None#

Registers callback to be invoked on a touch event. The callback receives one argument: the current number of touch points (0-5).

Pass None as callback to disable the callback. While a callback is registered, do not call FT5X06.update_points() outside of the callback.

update_points() int#

Reads the touch screen state and returns the number of touch points (0-5).

Constants#

ft5x06.GESTURE_MOVE_UP: int#

Touch screen move up gesture.

ft5x06.GESTURE_MOVE_LEFT: int#

Touch screen move left gesture.

ft5x06.GESTURE_MOVE_DOWN: int#

Touch screen move down gesture.

ft5x06.GESTURE_MOVE_RIGHT: int#

Touch screen move right gesture.

ft5x06.GESTURE_ZOOM_IN: int#

Touch screen zoom in gesture.

ft5x06.GESTURE_ZOOM_OUT: int#

Touch screen zoom out gesture.

ft5x06.GESTURE_NONE: int#

No gesture.

ft5x06.FLAG_PRESSED: int#

Touch point is pressed.

ft5x06.FLAG_RELEASED: int#

Touch point is released.

ft5x06.FLAG_MOVED: int#

Touch point is moved.