• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

touchscreen.begin(touchscreenSPI) in Learn LVGL examples?

Q&A Forum › Category: ESP32 › touchscreen.begin(touchscreenSPI) in Learn LVGL examples?
0 Vote Up Vote Down
Geoffrey Webster asked 6 months ago

Example code in the eBook “Learn LVGL GUIs for ESP32 Projects” shows the expression touchscreen.begin(touchscreenSPI); in the setup() routine. This flags up as an error in PlatformIO stating “too many arguments in function call”. Removing touchscreenSPI from within the brackets solves the problem.
Looking at the code within the “begin” function within the XPT2046_Touchscreen code, no argument is expected. Once the argument is removed from the expression, the code compiles and runs correctly.
I presume the example codes are in error?

Question Tags: LVGL
5 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 6 months ago

Hi.
I don’t know.
It works just fine in Arduino IDE.
Maybe you have a different version of the library in PlatformIO?
Regards,
Sara

0 Vote Up Vote Down
Geoffrey Webster answered 6 months ago

Hi Sara,
Thanks for coming back on this.
Looks like PlatformIO is using the previous release (1.3) to what Arduino IDE (1.4) is using. The newer version allows for multiple display objects, hence the availability of the touchscreen.begin(touchscreenSPI) statement. Both versions work fine with touchscreen.begin().
Regards,
Geoff

0 Vote Up Vote Down
Sara Santos Staff answered 6 months ago

Great.
I’ll mark this issue as resolved. If you need further help, you just need to open a new question in our forum.
Regards,
Sara

0 Vote Up Vote Down
Geoffrey Webster answered 6 months ago

For the benefit of PlatformIO users who may want to take advantage of the newer version of the XPT2046 library, simply replace the current statement in the platformio.ini file (paulstoffregen/XPT2046_Touchscreen@0.0.0-alpha+sha.26b691b2c8) with PaulStoffregen/XPT2046_Touchscreen: Touchscreen Arduino Library for XPT2046 Touch Controller Chip
This will then match the version in use by the modules within the ebook
Geoff

0 Vote Up Vote Down
Sara Santos Staff answered 6 months ago

Great.
Thanks for the info.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.