URtouch and TFT configuration pins

Hi guys I ´ve been trying to make some simple button with my touchscreen but some libraries confuse me.

I´d like to know in case of using my Arduino Genuino how to put the right values in this statements,as follows:

UTFT        myGLCD(ITDB32S,38,39,40,41);------>  this has to do with the shields pin number boards
UTouch     myTouch(6,5,4,3,2);------------------->  the same thing.


My pins code header accordin to Arduino genuino is:

#define TFT_DC 9              
#define TFT_CS 10             
#define TFT_RST 8             
#define TFT_MISO 12           
#define TFT_MOSI 11           
#define TFT_CLK 13

I don´t understand very well how to replace it so that the touch application can work out.

Please someone who help me

Thank you so much!

Why do people use gobbledygook names?

#define ITDB32S			2	// SSD1289  (16bit)

This seems to be a SSD1289 with a 16-bit parallel interface.

You have got zero chance of running a 16-bit TFT on a Uno.
Just count the pins.

There is even less chance of having any spare pins for a bit-banged Touch controller.

UTFT is designed for certain models of screen from specially approved manufacturers.

If you want to post a link to an approved screen, I suspect that someone can advise you.
If you post a link to an actual screen (approved or not), someone might advise you.

Your first job is to remove your shoes and socks. And get counting.

David.

Hi David!,

WHat I just simply need is to read the pressure of my button and jump to another task.that´s all!.

I am using this TJCTM 24028 SPI module as fllows:

descarga.jpg

And I wired up like this with a modify that I made hooking up a resistor divider on each data bus:

I already have made it work out my module with this respecting this header:

#include "Adafruit_GFX.h"     
#include "Adafruit_ILI9341.h" 
#include "URTouch.h"          

#define TFT_DC 9              
#define TFT_CS 10             
#define TFT_RST 8             
#define TFT_MISO 12           
#define TFT_MOSI 11           
#define TFT_CLK 13           

 Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_MOSI, TFT_CLK, TFT_RST, TFT_MISO);  



And using URtouch I define like this:

#define t_SCK 3              
#define t_CS 4                
#define t_MOSI 5             
#define t_MISO 6              
#define t_IRQ 7               

URTouch ts(t_SCK, t_CS, t_MOSI, t_MISO, t_IRQ)


And I noticed the routine that reads the pressure is:


void loop()

{
int x, y;                         

  while(ts.dataAvailable())         
  {
    
    ts.read();                      
    x = ts.getX();      ----------> this read the pressure from touchscreen and points x,y            
    y = ts.getY();  

}

  }

What I need is to know how to modify to read a simple button on screen filled red for example so that every time I switch on it goes to another task.

Please help me!

Thanks a lot David!
My doubt is about I have to read all the pixels contained in the button or not?

descarga.jpg

Good day, Ganimides.

UTouch | URTouch libriry has the "Calibration" sketch. Use it (Correction of 3 rows in URTouchCD.h needed then) and Your touch screen will be work well.
My touch screen was mirrored before I calibrated it.