{"id":13802615,"url":"https://github.com/fantasticdonkey/uFT6336U","last_synced_at":"2025-05-13T13:32:34.750Z","repository":{"id":135862948,"uuid":"338401203","full_name":"fantasticdonkey/uFT6336U","owner":"fantasticdonkey","description":"MicroPython I2C driver for the Focus LCDs FT6336U capacitive touch panel controller IC.","archived":false,"fork":false,"pushed_at":"2021-02-21T22:10:56.000Z","size":1214,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-22T13:31:29.224Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fantasticdonkey.png","metadata":{"files":{"readme":"readme.rst","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-02-12T18:32:59.000Z","updated_at":"2024-03-16T08:59:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"f5d6475d-6139-42b3-a819-bfb650634c96","html_url":"https://github.com/fantasticdonkey/uFT6336U","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fantasticdonkey%2FuFT6336U","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fantasticdonkey%2FuFT6336U/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fantasticdonkey%2FuFT6336U/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fantasticdonkey%2FuFT6336U/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fantasticdonkey","download_url":"https://codeload.github.com/fantasticdonkey/uFT6336U/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253950277,"owners_count":21989333,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T00:01:48.602Z","updated_at":"2025-05-13T13:32:34.400Z","avatar_url":"https://github.com/fantasticdonkey.png","language":"Python","funding_links":[],"categories":["Libraries"],"sub_categories":["Sensors"],"readme":"MicroPython I2C driver for the Focus LCDs FT6336U capacitive touch panel controller IC.\n\n.. image:: docs/FT6336u.jpg\n\nBasic usage\n===============\n\nThe driver simply requires a MicroPython :code:`I2C` object to be instantiated. Refer to your development board's schematics to establish the correct I2C pins.\n\n.. code-block:: python\n\n    from machine import I2C, Pin\n\n    I2C_SDA_PIN = const(21)\n    I2C_SCL_PIN = const(22)\n    I2C_FREQ = const(400000)\n    i2c_bus = I2C(sda=Pin(I2C_SDA_PIN), scl=Pin(I2C_SCL_PIN), freq=I2C_FREQ)\n\nThe FT6336U driver can then be instantiated using the :code:`I2C` object. For the simplest operation, use the :code:`touch.get_positions()` method to return the X and Y coordinates of the registered point(s). This will return a maximum of two points. If the device cannot be found, make sure that the IC is powered (for example, if it is connected to a separate power management chip).\n\n.. code-block:: python\n\n    import uFT6336U\n    touch = uFT6336U.FT6336U(i2c_bus)\n\n    touch.get_positions()\n\n.. image:: docs/get_positions.png\n\nUse with interrupt\n====================\n\nFor best results, use the driver with the designated interrupt pin. This way, discreet code can be triggered based on newly registered points.\n\n.. code-block:: python\n\n    INTERRUPT_PIN = const(39)\n\n    def handle_interrupt(pin):\n        num_points = touch.get_points()\n        if num_points \u003e 0:\n            print(touch.get_p1_x(), touch.get_p1_y())\n        if num_points == 2:\n            print(touch.get_p2_x(), touch.get_p2_y())\n\n    pir = Pin(INTERRUPT_PIN, Pin.IN)\n\n    pir.irq(trigger=Pin.IRQ_RISING, handler=handle_interrupt)\n\n.. image:: docs/get_positions_irq.png\n\nFurther reading\n===================\n\n* `FT6336U datasheet \u003chttps://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/Ft6336GU_Firmware%20%E5%A4%96%E9%83%A8%E5%AF%84%E5%AD%98%E5%99%A8_20151112-%20EN.xlsx\u003e`_\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffantasticdonkey%2FuFT6336U","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffantasticdonkey%2FuFT6336U","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffantasticdonkey%2FuFT6336U/lists"}