Skip to content

Latest commit

 

History

24 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

initGT911 Touch Library

Arduino Library Manager License: MIT GitHub release Author

A complete Arduino-compatible driver for the Goodix GT911 capacitive touch controller, supporting Arduino, ESP8266, and ESP32 boards.
Includes functions for initialization, touch point reading, interrupt handling, and display configuration.


📦 Installation

  1. Clone or download this repository:
    git clone https://github.com/milad-nikpendar/initGT911.git
  2. Copy the folder to your Arduino libraries directory.
  3. Restart the Arduino IDE.
  4. Alternatively, use Sketch → Include Library → Add .ZIP Library if you downloaded the ZIP.

⚡ Hardware Setup

GT911 Pin Connects To
SDA SDA (I2C)
SCL SCL (I2C)
INT Digital pin for interrupt
RST Digital pin for reset
VCC 3.3V
GND GND

Note: The GT911 operates at 3.3V logic.


🛠 Usage

1. Include the library

#include <Wire.h>
#include "initGT911.h"

2. Create an instance

initGT911 touch(&Wire, GT911_I2C_ADDR_5D); // or GT911_I2C_ADDR_28

3. Initialize in setup()

void setup() {
  Serial.begin(115200);
  if (touch.begin(INT_PIN, RST_PIN, 400000)) {
    Serial.println("GT911 Initialized!");
  } else {
    Serial.println("GT911 Not Found!");
  }
}

4. Read touch points

void loop() {
  uint8_t touches = touch.touched(GT911_MODE_INTERRUPT);
  if (touches > 0) {
    for (uint8_t i = 0; i < touches; i++) {
      GTPoint p = touch.getPoint(i);
      Serial.printf("Touch %d: X=%d, Y=%d\n", i, p.x, p.y);
    }
  }
}

📚 Key Functions

Function Description
begin(intPin, rstPin, clk) Initializes the GT911 with interrupt and reset pins
touched(mode) Returns the number of touch points detected
getPoint(num) Returns coordinates of a specific touch point
getPoints() Returns array of all detected touch points
readConfig() Reads current configuration from GT911
updateConfig() Updates GT911 configuration
setupDisplay(xRes, yRes, rotation) Sets display resolution and rotation

📜 License

This project is licensed under the MIT License – see LICENSE for details.


✍️ Author

Milad Nikpendar
GitHub: milad-nikpendar/initGT911
Email: milad82nikpendar@gmail.com

About

GT911 capacitive touch, Arduino, ESP8266, ESP32 — streamlined driver for fast initialization, precise multi‑touch tracking, and effortless integration.

Resources

Stars

8 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages