aselectroworks / arduino-ft6336u Goto Github PK
View Code? Open in Web Editor NEWFocalTech FT6336U (Self-Capacitive Touch Panel Controller) library for Arduino.
License: MIT License
FocalTech FT6336U (Self-Capacitive Touch Panel Controller) library for Arduino.
License: MIT License
Hello,
I use your library for a project, but I have a few issues.
I find that the value read_touch1_weight()never gives data.
Also, if the display is at rest, it still shows random touch events with ft6336u.read_touch1_event().
Finally, is it possible to have the display start at x=0 and y = 0 ?
Thanks very much. Attached is a small sketch to demonstrate this on a WT32-SCO1 display. Your library is advised by the manufacturer.
Erik, PA0ESH
WT32-SCO1-ReadTouchParam.ino.ino.zip
I use ESP32S3 and the code configuration is as follows.
#define I2C_SDA 2
#define I2C_SCL 1
#define RST_N_PIN -1
#define INT_N_PIN -1
FT6336U ft6336u(I2C_SDA, I2C_SCL, RST_N_PIN, INT_N_PIN);
When I looked at the serial port, after each reset, the serial port printed the following, of course, ft6336 is working normally.
E (16) gpio: gpio_set_level(226): GPIO output gpio_num error
E (26) gpio: gpio_set_level(226): GPIO output gpio_num error
I checked the FT6336U.cpp file. The problem is with the function digitalWrite(rst n, X).
It is located on lines 44 and 46.
I printed the values for rst_n and int_n and found that they were both 255, not -1.
So. I submit feedback to you.
When compiling it mainly complains about the order of the variable declarations
Swapping line 192 and 193 in the header file fixes the issue.
Compile log:
In file included from lib\Arduino-FT6336U\src\FT6336U.cpp:9:0:
lib\Arduino-FT6336U\src\FT6336U.h:127:14: warning: extra tokens at end of #ifdef directive
#ifdef ESP32 || ESP8266
^
lib\Arduino-FT6336U\src\FT6336U.cpp:16:14: warning: extra tokens at end of #ifdef directive
#ifdef ESP32 || ESP8266
^
In file included from lib\Arduino-FT6336U\src\FT6336U.cpp:9:0:
lib\Arduino-FT6336U\src\FT6336U.h: In constructor 'FT6336U::FT6336U(uint8_t, uint8_t)':
lib\Arduino-FT6336U\src\FT6336U.h:193:22: error: 'FT6336U::rst_n' will be initialized after [-Werror=reorder]
uint8_t rst_n = -1;
^
lib\Arduino-FT6336U\src\FT6336U.h:192:22: error: 'uint8_t FT6336U::int_n' [-Werror=reorder]
uint8_t int_n = -1;
^
lib\Arduino-FT6336U\src\FT6336U.cpp:13:1: error: when initialized here [-Werror=reorder]
FT6336U::FT6336U(uint8_t rst_n, uint8_t int_n)
^
In file included from lib\Arduino-FT6336U\src\FT6336U.cpp:9:0:
lib\Arduino-FT6336U\src\FT6336U.h: In constructor 'FT6336U::FT6336U(uint8_t, uint8_t, uint8_t, uint8_t)':
lib\Arduino-FT6336U\src\FT6336U.h:193:22: error: 'FT6336U::rst_n' will be initialized after [-Werror=reorder]
uint8_t rst_n = -1;
^
lib\Arduino-FT6336U\src\FT6336U.h:192:22: error: 'uint8_t FT6336U::int_n' [-Werror=reorder]
uint8_t int_n = -1;
^
lib\Arduino-FT6336U\src\FT6336U.cpp:17:1: error: when initialized here [-Werror=reorder]
FT6336U::FT6336U(uint8_t sda, uint8_t scl, uint8_t rst_n, uint8_t int_n)
^
lib\Arduino-FT6336U\src\FT6336U.cpp: In member function 'uint8_t FT6336U::readByte(uint8_t)':
lib\Arduino-FT6336U\src\FT6336U.cpp:254:12: warning: 'rdData' may be used uninitialized in this function [-Wmaybe-uninitialized]
return rdData;
^
cc1plus.exe: some warnings being treated as errors
In file included from src\main.cpp:15:0:
lib/Arduino-FT6336U/src/FT6336U.h:127:14: warning: extra tokens at end of #ifdef directive
#ifdef ESP32 || ESP8266
^
I am using a WT32-SC01 board. I have this working with TFT_eSPI library for display and your library for touch. I need to rotate the touch input to match the screen rotation. How may I do that? Still seems to be some minor issues but none that affect me at the moment. I just need X and Y of the touch. The current rotation is where the power connector is on the left of the WT32. I don't see any routine for rotation.
Thanks for the library!!
Mike
Resistive touch screen XPT2026 has a function touch.setRotation(1);
How can we do the same with capacitive FT6336U ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.