Skip to content

natheihei/CircuitPython_AXS5106

Repository files navigation

Introduction

Discord Build Status Code Style: Ruff

Driver for AXS5106 touch controller

Dependencies

This driver depends on:

Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle or individual libraries can be installed using circup.

Installing to a Connected CircuitPython Device with Circup

Make sure that you have circup installed in your Python environment. Install it with the following command if necessary:

pip3 install circup

With circup installed and your CircuitPython device connected use the following command to install:

circup install axs5106

Or the following command to update an existing version:

circup update

Usage Example

import board
import digitalio
from axs5106 import AXS5106L

# Initialize I2C bus
i2c = board.I2C()

# Initialize reset pin
reset = digitalio.DigitalInOut(board.TOUCH_RST)

# Initialize the touch controller with rotation and screen dimensions
# rotation=4 is 90° clockwise, adjust based on your display orientation
touch = AXS5106L(i2c, reset_pin=reset, rotation=4, dimensions=(320, 240))

# Main loop
while True:
    # Check if screen is being touched
    if touch.touched:
        # Get all touch points (supports up to 5 simultaneous touches)
        points = touch.touches
        for point in points:
            print(f"Touch {point['id']}: X={point['x']}, Y={point['y']}")

Documentation

API documentation for this library can be found on Read the Docs.

For information on building library documentation, please check out this guide.

Contributing

Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.

About

CircuitPython Driver for AXS5106 touch controller

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages