An Arduino library for the CST816S capacitive touch screen IC
fbiego / cst816s Goto Github PK
View Code? Open in Web Editor NEWAn Arduino library for the Hynitron CST816S capacitive touch screen IC
License: MIT License
An Arduino library for the Hynitron CST816S capacitive touch screen IC
License: MIT License
I hope it is ok to write my question under the issue field. Has someone tried this library with CST816T chips?
With best regards!
I think it has some issues.
Tried to compile with Arduino-IDE 2.2,1
Here is the compilation errors when I try to compile for ESP32C3.
Also there are some compilation errors with ESP8266..
/home/death/Arduino/libraries/CST816S/CST816S.cpp: In member function 'uint8_t CST816S::i2c_read(uint16_t, uint8_t, uint8_t*, uint32_t)':
/home/death/Arduino/libraries/CST816S/CST816S.cpp:173:38: error: call of overloaded 'requestFrom(uint16_t&, uint32_t&, bool)' is ambiguous
Wire.requestFrom(addr, length, true);
^
In file included from /home/death/Arduino/libraries/CST816S/CST816S.cpp:26:
/home/death/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/Wire/src/Wire.h:119:12: note: candidate: 'size_t TwoWire::requestFrom(uint16_t, size_t, bool)'
size_t requestFrom(uint16_t address, size_t size, bool sendStop);
^~~~~~~~~~~
/home/death/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/Wire/src/Wire.h:120:13: note: candidate: 'uint8_t TwoWire::requestFrom(uint16_t, uint8_t, bool)'
uint8_t requestFrom(uint16_t address, uint8_t size, bool sendStop);
^~~~~~~~~~~
/home/death/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/Wire/src/Wire.h:121:13: note: candidate: 'uint8_t TwoWire::requestFrom(uint16_t, uint8_t, uint8_t)'
uint8_t requestFrom(uint16_t address, uint8_t size, uint8_t sendStop);
^~~~~~~~~~~
/home/death/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/Wire/src/Wire.h:122:12: note: candidate: 'size_t TwoWire::requestFrom(uint8_t, size_t, bool)'
size_t requestFrom(uint8_t address, size_t len, bool stopBit);
^~~~~~~~~~~
/home/death/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/Wire/src/Wire.h:124:13: note: candidate: 'uint8_t TwoWire::requestFrom(uint8_t, uint8_t, uint8_t)'
uint8_t requestFrom(uint8_t address, uint8_t size, uint8_t sendStop);
^~~~~~~~~~~
/home/death/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/Wire/src/Wire.h:126:13: note: candidate: 'uint8_t TwoWire::requestFrom(int, int, int)'
uint8_t requestFrom(int address, int size, int sendStop);
^~~~~~~~~~~
exit status 1
Compilation error: exit status 1
For fixing it, you should use size_t at wire definitions...
uint8_t i2c_read(uint16_t addr, uint8_t reg_addr, uint8_t * reg_data, size_t length);
uint8_t i2c_write(uint8_t addr, uint8_t reg_addr, const uint8_t * reg_data, size_t length);
My touch chip is CST816T.
I tried this library, it works well, except that the y position is always less than 255.
According to the datasheet, maybe x and y should be:
data.x = data_raw[2] & 0xF;
data.x = (data.x << 8) + data_raw[3];
data.y = data_raw[4] & 0xF;
data.y = (data.y << 8) + data_raw[5];
So I've been testing this on an RP2040 and also ESP32....
The Double Tap (click) never triggers, no matter how fast or slow I try tapping the screen, it only ever registers a SINGLE tap
Touch points is always 1 - I'm not entirely sure what this is supposed to do, but it's just always 1
Event - from the library comments I'm assuming this is meant to allow you to differentiate between touching and releasing but it just doesn't really work. when touching, it's 2, when I remove my finger after a swipe for example, 95% of the time it remains 2. Rarely it will show 1 which Is what I would expected when removing my finger / exiting the screen
This is a great start at a library, but it really isn't hugely useful in it's current state because of the inconsistencies etc
How does one deduce when an action has been completed RELIABLY? Again, Double Tap/Click is never recognised either
Hi, where should I define the screen size?
hello ,
On compiling the code in arduino , i Get this error
Arduino: 1.8.16 (Windows 7), Board: "Arduino Uno"
In file included from C:\Users\vishal\Documents\Arduino\libraries\CST816S-1.1.0\CST816S.cpp:27:0:
C:\Users\vishal\Documents\Arduino\libraries\CST816S-1.1.0/FunctionalInterrupt.h:7:10: fatal error: functional: No such file or directory
#include "functional"
^~~~~~~~~~~~
compilation terminated.
exit status 1
Error compiling for board Arduino Uno.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Hello,
Do you have the CST816S Data Reference document which lists all the addresses and technical information ?
Also is the CST816S the same as the CST816D ?
We need to increase the swipe detection response.
Thanks
I'm sure I'm missing something, but I can't get any gesture information.
No matter what I do on the screen gesture always returns "NONE".
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.