GithubHelp home page GithubHelp logo

Comments (11)

embeddedt avatar embeddedt commented on June 11, 2024

@winny2809 It's likely that your touch screen is not calibrated correctly, so you never touch any of the objects on the screen (e.g. buttons). However, the tpcal example is designed to calibrate the screen so it will register touches anywhere.

from lv_port_esp32.

winny2809 avatar winny2809 commented on June 11, 2024

The problem is that even creating an object with the call function, when you touch any point on the screen no event is generated, an event is generated only by using the "tpcal_create" function.
It is as if only the "tpcal_create" function read the interrupt from the touch screen.
Why?

from lv_port_esp32.

kisvegabor avatar kisvegabor commented on June 11, 2024

tp_cal checks to the whole display area for clicks. I suggest to printf the measured raw touchpad data from your driver to see if it's correct.

from lv_port_esp32.

embeddedt avatar embeddedt commented on June 11, 2024

The problem is that even creating an object with the call function, when you touch any point on the screen no event is generated, an event is generated only by using the "tpcal_create" function.

That is because, as I said above, in the other examples there are small objects on the screen in various places. It just so happens that the current data you are reading from your touchscreen is not hitting those areas.

However, think of tpcal as creating a huge button that covers the whole screen. No matter where the data you read claims you touch, the huge button will always get clicked as it fills the whole touchscreen.

As @kisvegabor said it's likely that the coordinate data you are reading is bogus.

from lv_port_esp32.

winny2809 avatar winny2809 commented on June 11, 2024

And then? in this case how should I proceed? Excuse me

from lv_port_esp32.

embeddedt avatar embeddedt commented on June 11, 2024

in this case how should I proceed?

First, let's figure out whether it's bogus or not. That is, does touching the top left of the screen give you roughly (0,0), and does touching the bottom right give you a coordinate around the screen width and height (i.e. for 240x320 (240, 320))?

from lv_port_esp32.

winny2809 avatar winny2809 commented on June 11, 2024

IMG_20190919_161127

This is the result

from lv_port_esp32.

kisvegabor avatar kisvegabor commented on June 11, 2024

It's cleary the issue of the driver. Probably you read always 0xFF. Typically it indicates a problem with the SPI. (wrong pins or wrong configuration)

from lv_port_esp32.

winny2809 avatar winny2809 commented on June 11, 2024

I have the doit devkit v1 card.
My configuration is:

#define XPT2046_IRQ 25

#define ENABLE_TOUCH_INPUT 1

#define TP_SPI_MOSI 23
#define TP_SPI_MISO 19
#define TP_SPI_CLK 18
#define TP_SPI_CS 5

from lv_port_esp32.

winny2809 avatar winny2809 commented on June 11, 2024

the vspi configuration is:

void tp_spi_init(void)
{

esp_err_t ret;

spi_bus_config_t buscfg={
	.miso_io_num=TP_SPI_MISO,
	.mosi_io_num=TP_SPI_MOSI,
	.sclk_io_num=TP_SPI_CLK,
	.quadwp_io_num=-1,
	.quadhd_io_num=-1
};

spi_device_interface_config_t devcfg={
	.clock_speed_hz=10*1000*1000,           //Clock out at 80 MHz
	.mode=0,                                //SPI mode 0
	.spics_io_num=-1,              //CS pin
	.queue_size=1,
	.pre_cb=NULL,
	.post_cb=NULL,
};

//Initialize the SPI bus
ret=spi_bus_initialize(VSPI_HOST, &buscfg, 2);
assert(ret==ESP_OK);

//Attach the LCD to the SPI bus
ret=spi_bus_add_device(VSPI_HOST, &devcfg, &spi);
assert(ret==ESP_OK);

}

from lv_port_esp32.

kisvegabor avatar kisvegabor commented on June 11, 2024

Let's continue in the Forum because more users read it.
Hopefully, somebody already has experience with this configuration.

from lv_port_esp32.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.