Register / Login  |  Desktop view  |  Jump to bottom of page

tcMenu Arduinio library » 'iotouch' does not name a type

Author: Lagomorphs
23/08/2021 17:20:53
Aloha all,
I hope someone can help me. I am trying to compile the colorTfthernet32 example with two changes. The changes are that I selected the "Resistive touch screen on analog inputs" and display type ILI9341. I have the most recent versions of everything. When I compile, I get the following error. Thanks, Tom.



Arduino: 1.8.15 (Windows 10), Board: "ESP32 Dev Module, Disabled, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 240MHz (WiFi/BT), QIO, 80MHz, 4MB (32Mb), 921600, None"


In file included from C:\Users\Lagomorphs\Documents\Arduino\test\test_menu.cpp:12:0:

test_menu.h:28:8: error: 'iotouch' does not name a type

extern iotouch::ResistiveTouchInterrogator touchInterrogator;

^

test_menu.h:29:8: error: 'MenuTouchScreenManager' does not name a type

extern MenuTouchScreenManager touchScreen;

^

test_menu.cpp:21:1: error: 'iotouch' does not name a type

iotouch::ResistiveTouchInterrogator touchInterrogator(21, A0, 22, A1);

^

test_menu.cpp:22:1: error: 'MenuTouchScreenManager' does not name a type

MenuTouchScreenManager touchScreen(&touchInterrogator, &renderer, iotouch::TouchInterrogator::PORTRAIT);

^

C:\Users\Lagomorphs\Documents\Arduino\test\test_menu.cpp: In function 'void setupMenu()':

test_menu.cpp:89:5: error: 'touchScreen' was not declared in this scope

touchScreen.start();

^

In file included from C:\Users\Lagomorphs\Documents\Arduino\test\test.ino:1:0:

test_menu.h:28:8: error: 'iotouch' does not name a type

extern iotouch::ResistiveTouchInterrogator touchInterrogator;

^

test_menu.h:29:8: error: 'MenuTouchScreenManager' does not name a type

extern MenuTouchScreenManager touchScreen;

^

exit status 1

'iotouch' does not name a type

Author: davetcc
23/08/2021 20:52:51
What IoAbstraction version do you have installed? We usually see this when it’s the version before touch was added.

Author: Lagomorphs
24/08/2021 17:08:15
Aloha Dave, I have 2.0.5 which I believe is the most recent version.

Author: davetcc
24/08/2021 17:46:25
We have a couple of examples based on touch so it seems there must be an edge case with the settings.

Can you please zip up an example project and attach it here ( or use PM if you don't want to publicly post it ) so that we can try and load it into an IDE. We have a couple of ESP32 boards to hand so can readily test.

Thanks,
Dave.

Author: Lagomorphs
24/08/2021 20:02:48
Aloha Dave, thanks for your prompt replies. As I was recreating the problem, I noticed I had selected the wrong display the AdafruitGFX quick start. When I tried the TFT_eSPI it works fine except for a 'tft' was not declared in this scope error in _menu.cpp

The generated code looks like:

// Set up code

void setupMenu() {
tft.begin();

but if I change it to:

// Set up code
TFT_eSPI tft = TFT_eSPI(); // added this line
void setupMenu() {
tft.begin();

it compiles and works just fine. I don't know if this is a bug or I am doing something wrong. But it may help someone else with the same problem. Mahalos (thanks) for your help.

Author: davetcc
27/08/2021 06:50:16
Hi there,
I think you've made a mistake somewhere in the setup in that case, you should not need to declare the tft variable, it's done by the plugin.

Please check over the esp32Amplifier example that also uses TFT_eSPI and see how your configuration differs from that. As this example does not need to declare that variable. In fact declaring it again will create two instances and probably cause serious problems later.

Author: Lagomorphs
28/08/2021 15:57:56
Arduino: 1.8.15 (Windows 10), Board: "ESP32 Dev Module, Disabled, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 240MHz (WiFi/BT), QIO, 80MHz, 4MB (32Mb), 921600, None"



C:\Users\Lagomorphs\Documents\Arduino\New folder\new\new_menu.cpp: In function 'void setupMenu()':

new_menu.cpp:30:5: error: 'tft' was not declared in this scope

tft.begin();

^

exit status 1

'tft' was not declared in this scope

C:\Users\Lagomorphs\Documents\Arduino\New folder\new\new_menu.cpp: In function 'void setupMenu()':

new_menu.cpp:30:5: error: 'tft' was not declared in this scope

tft.begin();

^

exit status 1

'tft' was not declared in this scope



This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

I can't find esp32Amplifier anywhere???

I'm including the .emf file and the code it generated which give the above error, plus the User_setup.h file I used. Thanks.

Author: Lagomorphs
28/08/2021 17:50:49
Hi Dave, I finally found ESP32Amplifier. The library version doesn't have an .ino suffix and doesn't show up in the examples, so I rebuilt it with tcMenu using a rotary encoder, since my tft boards don't have analog outputs, it compiles and works fine. I wish there was a plugin for the XPT2046 touch panel tft boards.

Author: davetcc
29/08/2021 07:24:25
Esp32Amplifier is working example that is within the examples, it's really intended for use with platformIO and uses a C++ for the main instead of an INO file.

https://github.com/davetcc/tcMenuLib/blob/master/examples/esp32Amplifier/esp32Amplifier_main.cpp

I've attached an example of how it should be configured below, in case you are having difficulties locating the EMF file.

In terms of the XPT2046 support, we'd like to support both that chip and FT6206 based touch screens, but we don't have either to hand at the moment.

[Thumb - tft-espi-exmple.png]
Filename tft-espi-exmple.png
Description No description given
Filesize 32 Kbytes
Downloaded 1095 time(s)
[Disk] Download


Author: microsoftexam
03/09/2021 16:53:00
 
davetcc wrote:Esp32Amplifier is working example that is within the examples, it's really intended for use with platformIO and uses a C++ for the main instead of an INO file.

https://github.com/davetcc/tcMenuLib/blob/master/examples/esp32Amplifier/esp32Amplifier_main.cpp

I've attached an example of how it should be configured below, in case you are having difficulties locating the EMF file.

In terms of the XPT2046 support, we'd like to support both that chip and FT6206 based touch screens, but we don't have either to hand at the moment.


Thanks it worked for me

Author: davetcc
25/09/2021 15:31:14
 
I wish there was a plugin for the XPT2046 touch panel tft boards.


Getting hold of capacitive touch display units is harder than I expected! I managed to finally source an adafruit breakout 2.8" TFT with i2c capacitive touch. This will let me implement for FT6206 / CST026.

Once this is implemented, I plan to try and find an XPT2046 standalone display unit - but I'm not finding much other than one with the ESP32 built in.

I'm also going to write up how to implement the override class needed to support a different touch chip. It's really easy as most of the code is shared - just needs documenting.

Author: davetcc
25/09/2021 15:58:15
A new topic just for touch screen support.

https://www.thecoderscorner.com/jforum/posts/list/160.page




Register / Login  |  Desktop view  |  Jump to top of page