XPT2046_Touchscreen

Hello
I can compile this with the Arduino IDE

SPIClass mySpi = SPIClass(VSPI);
XPT2046_Touchscreen ts(XPT2046_CS, XPT2046_IRQ);

TFT_eSPI tft = TFT_eSPI();

void setup() {
  Serial.begin(115200);

  // Start the SPI for the touch screen and init the TS library
  mySpi.begin(XPT2046_CLK, XPT2046_MISO, XPT2046_MOSI, XPT2046_CS);
  // ts.begin(SPI1);
  ts.begin(mySpi);

but not with PlatformIO.
I get the Error
src/main.cpp:69:17: error: no matching function for call to ‘XPT2046_Touchscreen::begin(SPIClass&)’
Any Clue ?

Some basic information are missing, such as the platform used, the board used, the version number of the framework used (both ArduinoIDE and PlatformIO).

To make a comparison, show a screenshot of your board settings in the ArduinoIDE and share the content of your platformio.ini.

; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[env:esp-wrover-kit]
platform = espressif32
board = esp-wrover-kit
framework = arduino
monitor_port = COM11
upload_port = COM11
monitor_speed = 115200

lib_deps = Bodmer/TFT_eSPI
           bitbank2/PNGdec@^1.0.2
		   paulstoffregen/XPT2046_Touchscreen

build_flags =
	-DUSER_SETUP_LOADED
	-DUSE_HSPI_PORT
	-DXPT2046_IRQ=36
    -DXPT2046_MOSI=32
    -DXPT2046_MISO=39
    -DXPT2046_CLK=25
    -DXPT2046_CS=33
	-DTFT_MISO=12
	-DTFT_MOSI=13
	-DTFT_SCLK=14
	-DTFT_CS=15
	-DTFT_DC=2
	-DTFT_RST=-1
	-DTFT_BL=21
	-DTFT_SWRST=0x01
	-DTFT_PASET=0x2B
	-DTFT_INVOFF=0x20
	-DTFT_INVON=0x21
	-DTFT_INIT_DELAY=0x80
	-DTFT_RAMRD=0x2E
	-DTFT_RAMWR=0x2C
	-DTFT_CASET=0x2A
	-DTFT_HEIGHT=240
	-DTFT_WIDTH=320
	-DTFT_BACKLIGHT_ON=HIGH
	-DSPI_FREQUENCY=55000000
	-DSPI_READ_FREQUENCY=20000000
	-DSPI_TOUCH_FREQUENCY=2500000
	-DLOAD_GLCD
	-DLOAD_FONT2
	-DLOAD_FONT4
	-DLOAD_FONT6
	-DLOAD_FONT7
	-DLOAD_FONT8
	-DLOAD_GFXFF
	-DILI9341_2_DRIVER
	-DTFT_RGB_ORDER=TFT_BGR
	-DTFT_INVERSION_OFF

PlatformIO Core, version 6.1.15

Arduino IDE 2.2.1

You use different boards.
“ESP32 Dev Module” in ArduinoIDE is board = esp32dev in platformio.ini.

Please check the used Arduino versions!

PlatformIO:
Compile your project and watch the output:

PACKAGES: 
 - framework-arduinoespressif32 @ 3.20016.0 (2.0.16) 

The number in brackets is the Arduino version. (Here: 2.0.16)

ArduinoIDE:
Click “Boards Manager” on the left side.
Enter “Espressif” in the search bar:

image

In the screenshot above the Arduino version is 2.0.17.

Hello!
I solved the Problem.
This works: git@github.com:PaulStoffregen/XPT2046_Touchscreen.git
This not: paulstoffregen/XPT2046_Touchscreen

Thank you for helping @sivar2311!
Thank you very much.

Yes, it looks like the library never got an update in the PlatformIO registry.
It is still on verison 0.0.0 alpha. On github it is on version 1.4

cc @ivankravets any chance to update “paulstoffregen/XPT2046_Touchscreen” in the registry? github vs registry

See

2 Likes