Questions with regards to ESP8266 Basic and hardware interfacing and control via Basic commands

Moderator: Mmiscool

User avatar
By lpservices
#53588 Espbasic has functions to read the coordinates:
tft.touchx()
tft.touchy()

These functions return the translated coordinates, taking into account the rotation of the display, and the range of legal coordinates for the display

The pulsetrain from the MISO output from the touch controller should have about 3.3 V for the high level, 0 volt for the low level
If these levels are not correct the esp8266 wil not be able to reliably read the data.
Will post the patch required for translating the touch coordinates to match the ones from the display later tonight
You will need to recompile espbasic from source to implement them
User avatar
By tcpipchip
#53597 The problem is the i am not getting 0 to 3.3V on TFT MISO until that i disconnect it from LCD MISO.

I guess that i have to buy other LCD TOUCH

Can you compile for me ? and put in a dropbox or onedrive ?
User avatar
By tcpipchip
#53621
lpservices wrote:Espbasic has functions to read the coordinates:
tft.touchx()
tft.touchy()

These functions return the translated coordinates, taking into account the rotation of the display, and the range of legal coordinates for the display

The pulsetrain from the MISO output from the touch controller should have about 3.3 V for the high level, 0 volt for the low level
If these levels are not correct the esp8266 wil not be able to reliably read the data.
Will post the patch required for translating the touch coordinates to match the ones from the display later tonight
You will need to recompile espbasic from source to implement them


Nice, that patch to translating the touch coordinates to match the ones with display will be good, because i am getting success on read some pieces of TOUCH display! Not the pieces where there is buttons or checkbox!
User avatar
By lpservices
#53638 Hello,

you can disconnect the MISO output from the TFT controller without any problems
espbasic does not require this line to be connected, this line is only used to read from the display,
and espbasic never read from the display, just writes to it.
Try to disconnect this line, and you will see the display functions normally

Below is the code I changed to match the touch orientation tot that of the display
I will try to compile a version with these altered function this evening

this is the codeblock in ReadTouchXY I replaced for the reversed X axis on my display:

my altered code:

switch (tft->getRotation())
{
case 0:
xf = 240 -x;
yf = y;
break;
case 1:
xf = y;
yf = x;
break;
case 2:
xf = x;
yf = 320-y;
break;
case 3:
xf = 320 -y;
yf = 240 - x;
break;
}

The original code :

switch (tft->getRotation())
{
case 0:
xf = 240 - x;
yf = 320 - y;
break;
case 1:
xf = 320 - y;
yf = x;
break;
case 2:
xf = x;
yf = y;
break;
case 3:
xf = y;
yf = 240 - x;
break;
}