trouble calibrating what "I think" is a adafruit 2.8inch touchscreen

ok here is my problem...

My 2.8inch screen Adafruit display cracked, soo I ordered another to keep developing my project and it just wont work...

I used the MCUFriend calibration app TouchScreen_Calibr_native.ino like I did for the last one and it seems to work... But... the resulting parameters dont look correct to, actualy they dont make any sense (I think!)

test du 24 jan 2020

TouchScreen.h GFX Calibration
Making all control and bus pins INPUT_PULLUP
Typical 30k Analog pullup with corresponding pin
would read low when digital is written LOW
e.g. reads ~25 for 300R X direction
e.g. reads ~30 for 500R Y direction

Testing : (A1, D6) = 20
Testing : (A2, D7) = 40
Diagnosing as:-
XM,XP:  (A1, D6) = 20
YP,YM:  (A2, D7) = 40
ID = 0x9338

cx=341 cy=726 cz=102 LEFT, TOP, Pressure
cx=350 cy=663 cz=103 LEFT, MIDH, Pressure
cx=306 cy=506 cz=104 LEFT, BOT, Pressure
cx=410 cy=732 cz=102 MIDW, TOP, Pressure
cx=405 cy=584 cz=104 MIDW, BOT, Pressure
cx=504 cy=745 cz=102 RT, TOP, Pressure
cx=517 cy=645 cz=104 RT, MIDH, Pressure
cx=466 cy=597 cz=104 RT, BOT, Pressure
MCUFRIEND_kbv ID=0x9338  240 x 320

const int XP=6,XM=A1,YP=A2,YM=7; //240x320 ID=0x9338
const int TS_LEFT=324,TS_RT=502,TS_TOP=739,TS_BOT=556;
PORTRAIT CALIBRATION     240 x 320
x = map(p.x, LEFT=324, RT=502, 0, 240)
y = map(p.y, TOP=739, BOT=556, 0, 320)
Touch Pin Wiring XP=6 XM=A1 YP=A2 YM=7
LANDSCAPE CALIBRATION    320 x 240
x = map(p.y, LEFT=739, RT=556, 0, 320)
y = map(p.x, TOP=502, BOT=324, 0, 240)


test 3 24 janvier

363, tp.y=704, tp.z =103
tp.x=TouchScreen.h GFX Calibration
Making all control and bus pins INPUT_PULLUP
Typical 30k Analog pullup with corresponding pin
would read low when digital is written LOW
e.g. reads ~25 for 300R X direction
e.g. reads ~30 for 500R Y direction

Testing : (A1, D6) = 23
Testing : (A2, D7) = 31
Diagnosing as:-
XM,XP:  (A1, D6) = 23
YP,YM:  (A2, D7) = 31
ID = 0x9338

cx=340 cy=732 cz=103 LEFT, TOP, Pressure
cx=271 cy=612 cz=104 LEFT, MIDH, Pressure
cx=297 cy=488 cz=103 LEFT, BOT, Pressure
cx=439 cy=780 cz=103 MIDW, TOP, Pressure
cx=418 cy=544 cz=105 MIDW, BOT, Pressure
cx=619 cy=805 cz=103 RT, TOP, Pressure
cx=501 cy=650 cz=102 RT, MIDH, Pressure
cx=472 cy=590 cz=103 RT, BOT, Pressure
MCUFRIEND_kbv ID=0x9338  240 x 320

const int XP=6,XM=A1,YP=A2,YM=7; //240x320 ID=0x9338
const int TS_LEFT=291,TS_RT=540,TS_TOP=779,TS_BOT=532;
PORTRAIT CALIBRATION     240 x 320
x = map(p.x, LEFT=291, RT=540, 0, 240)
y = map(p.y, TOP=779, BOT=532, 0, 320)
Touch Pin Wiring XP=6 XM=A1 YP=A2 YM=7
LANDSCAPE CALIBRATION    320 x 240
x = map(p.y, LEFT=779, RT=532, 0, 320)
y = map(p.x, TOP=540, BOT=291, 0, 240)

I am questioning if this is a Adafruit type display or something else? or if the display is simply DOA?

could not upload images the TFT is 1.8inch, on the right hand side along the edge of the glass it says "RS4-4 |.. ..|... ." on the back www.mcufriend.com 2.8inch TFT LCD Shield there are two IC (U2 and U3) but no regulator unlike my previous one?

Help! From a newby!

Richard VE2DX

const int XP=6,XM=A1,YP=A2,YM=7; //240x320 ID=0x9338
const int TS_LEFT=324,TS_RT=502,TS_TOP=739,TS_BOT=556;

It looks like you have a Touch Panel on the usual pins.
You seem to have consistent LEFT, RT, MIDW values.

But the absolute values look wrong. I would expect there to be about 800 difference between LEFT and RT (or TOP and BOT)
Your differences are only 175 instead of 800.

Run the Touch_Shield example with the default calibration. Press [EXIT]
In the Paint screen draw a horizontal line with your stylus. Note direction.
Repeat with Vertical line. Note direction.

Report back.

David.

ok finaly got calibration going but still having issues

Confirmed as 9338

loosing it

Yes, I have tidied up your sketch. Used regular buttons with 7x5 font. I still get random Buttons.

The Adafruit_GFX_Button class uses your "current" font to draw a Button. drawButton() leaves the text cursor, color, bgcolor, textsize in the state reached after printing the button label.

The normal strategy is to setFont(NULL) before calling drawButton() i.e. to use 7x5 font
And to setFont(your_Application_Font) afterwards.

Always set colour, size, cursor before any Application printing.

Yes, you could write a more complex Button class. But it would require a more complex MCUFRIEND_kbv class.

The TouchScreen operation is inherently "analog". You will always get some stray getPoint() results.
Your loop() calls getPoint() so often that you observe the "strays".

It might be safer to "debounce" the buttons like you do with a keyboard. e.g. getPoint() returns a steady value for 20ms or so.

I will post something tomorrow.
I really ought to start my Tax Return now.

David.