From 9d90031c7bb784ad117bb3325a85e246e5b12225 Mon Sep 17 00:00:00 2001 From: Felix Biego <45796740+fbiego@users.noreply.github.com> Date: Wed, 9 Aug 2023 23:34:31 +0300 Subject: [PATCH] fix #3 --- CST816S.cpp | 4 ++-- library.json | 2 +- library.properties | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CST816S.cpp b/CST816S.cpp index 3fd52f2..6b1d780 100644 --- a/CST816S.cpp +++ b/CST816S.cpp @@ -58,8 +58,8 @@ void CST816S::read_touch() { data.gestureID = data_raw[0]; data.points = data_raw[1]; data.event = data_raw[2] >> 6; - data.x = data_raw[3]; - data.y = data_raw[5]; + data.x = ((data_raw[2] & 0xF) << 8) + data_raw[3]; + data.y = ((data_raw[4] & 0xF) << 8) + data_raw[5]; } /*! diff --git a/library.json b/library.json index aa9da93..3ef3b1f 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "CST816S", - "version": "1.1.0", + "version": "1.1.1", "keywords": "Arduino, ESP32, Touch, Hynitron, CST816S, I2C", "description": "An Arduino library for the CST816S capacitive touch screen IC", "repository": diff --git a/library.properties b/library.properties index 7384039..cf90651 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=CST816S -version=1.1.0 +version=1.1.1 author=fbiego maintainer=fbiego sentence=Capacitive touch screen library