Closed ciobania closed 2 years ago
https://www.elegoo.com/products/elegoo-2-8-inches-tft-touch-screen
Looking at this picture, it looks like there are no pins for the touch screen.
There is no Chip Select to enable the touch screen.
If you scroll down on that page, it does display a pinout picture, describing what each pin does. There is a Chip Select option, which is LCD_CS, WiringPi number 8, in your pin.conf file, and that's how I have it wired as well. Is that what needs to be used?
The Arduino code I have from the CD, is using 2 analog pins, and two digital pins to drive the touch screen.
I'm new to all this, 8bit parallel pins, and what gets sent where, etc. I don't even know where to start learning it, to be honest.
Right now I'm trying to mount this TFT touch screen to my homemade thermostat.
The Arduino code I have from the CD, is using 2 analog pins, and two digital pins to drive the touch screen.
You need to parse the Arduino code in the CD.
This library supports SPI-Touch Sensor.
The following pins are required for the SPI-Touch Sensor.
Looking at the pictures, I don't know where these pins are.
Interesting. The board I use does not have an SPI interface, and I thought the library and pin setup accounts for that, whjich it did to a degree, and it allowed me to get my screen to display something, apart from the touch screen. Most of the boards you presented in the photos, have no PEN pinout, apart from the one configured towards the end of it.
./xpt doesn't work either, and I assume from your comment that it may be because of the SPI missing interface, or the "PEN" pin. I am familiar with SPI and I2C, and it is the first time I'm being introduced to the 8bit-16bit interfaces. I've been stuck at this for about 1 week, and only your instructions made some sense, and allowed me to get some output onto the screen.
Do you know if the touch screens generally only work on the SPI interface, or is it a hardware implementation depending on the model/brand/company that produces them? (I always assumed that these will use common interfaces: i.e. i2c, spi, usb, etc) Ultimately, if nothing comes out of it, I guess I'll have to buy a new touch screen for my needs. In all fairness, when I bought this few years back it was intended to use with Arduino, and now I'm in need of a similar device, with same features, but different hardware support. The Arduino library provided uses 2 analog pins, and 2 digital pins as a way to map the X+, Y+, X- and Y-. Any info you might have that can help me out figure what I'm missing, or how to make it work is very much appreciated.
Thanks for your help! I'll try to see if I missed something else.
I want to know how the Arduino code controls the touch sensor.
If you have the arduino code in your repository, I can see it.
I want to know how the Arduino code controls the touch sensor.
If you have the arduino code in your repository, I can see it.
Give me few minutes to upload it somewhere.
have a read here: https://github.com/ciobania/el-sm-04-tft-touch-screen-docs this is the entire CD documentation. The relevant parts are in here: https://github.com/ciobania/el-sm-04-tft-touch-screen-docs/blob/main/Example04-Touch/tftpaint/tftpaint.ino https://github.com/ciobania/el-sm-04-tft-touch-screen-docs/tree/main/Install%20libraries/TouchScreen
I saw the Arduino code. This code uses analogRead (). This is a specification called "4-wire resistive touch screen". Analog input is not possible with Raspberry Pi.
If you want to use the touch sensor with Pi, you need a TFT with xpt2046.
If you want to use the touch sensor with Pi, you need a TFT with xpt2046.
Can you point me to one such display, or provide some names/brands? How would I know if I'm purchasing the right thing (TFT with XPT2046)?
Thank you
I have this one. But I don't know if you can buy the same.
I searched for it, and couldn't find it. I have the one I posted with 8bit parallel interface, and just got another one with SPI interface, which I'm yet to make it work with Raspberry. So I'm stuck.
One thing I was considering was to get an analogue to digital sensor for raspberry, however I wonder if its possible to use/configure the arduino code from the docs I shared.
The idea is that the analog pins are used in order to have the posibility to use the other pins for something else, and not because the display is providing the data through analog. Maybe I'm wrong but thats what I understood from the docs
Yes. You are right.
The pins for the 4-wire resist touch screen are shared with the LCD control pins.
Analog pins are used not only because the display provides data via analog, but also to control the LCD. The pins on the 4-wire resist touch screen are used to switch between input and output.
I'll keep digging around, and see if I can get anywhere this week with any of the two displays.
I'm not too familiar with C/C++ so it's harder for me to understand how it all works.
Thanks again for your feedback, and help with it! Much appreciated!
I'm closing this as I was able to use a different screen, with dtoverlays.
Unable to use this repository, to drive my version screen, unfortunately.
Thank you for your help and feedback!
Hello,
Firstly, thank you for making this possible and sharing it; I've struggled to gather knowledge on how to make my display work with a Raspberry Pi for long time now.
I was able to run through most of the demo/examples you provided, successfully, apart from the last one with the touch screen.
My issue currently is that I cannot get input from the touch screen. I have compiled the touch binary with the 8BIT parameter, and when I run it, it displays the numbers, but that is pretty much all I can do with it; I see that in touch.c there is a pin defined for pen input on GPIO 6; I don't understand how that works, or where the input will come from, because my TFT screen does not have a separate pin for the PEN (I have the 8bit parallel version).
Because I have redefined the pins I'm using, I changed the pin in the touch.c file to an "empty" one, like it was initially (or that's how I'm reading it).
Here's my git diff output, to help you understand what I changed:
This is the TFT Screen I am using: elegoo 2.8"TFT Touch Screen Thank you kindly for your effort and feedback, and for making this possible! Much appreciated!
Stay safe and healthy, ciobania