'parseMenuTouch' was not declared in this scope

Hi all.
the ESP32_ILI9341 touch menu sketch got compiling error, how to fix please?
Thanks
Adam

#include <WiFi.h>                 //  Wifi
#include <WiFiUdp.h>              //  UDP
#include <NTPClient.h>            //  time server
#include <SD.h>                   //  SD Card
//#include <TinyGsmClient.h>      //  cell stuff.
#include <SPI.h>                  //  spi
#include <Adafruit_GFX.h>         //  graphics
#include <Adafruit_ILI9341.h>     //  display
#include <Adafruit_MLX90614.h>    //  Melexis IR temp
#include <Adafruit_MLX90640.h>    //  Flir
#include <MAX30105.h>             //  MAX30102 oxi/pulse (on hold just yet)new compile to ESP32 WROOM 32 today (9-15-2020)
#include <heartRate.h>            //  Heart rate calculating algorithm
#include <XPT2046_Touchscreen.h>  //  touch
#include <SparkFunBME280.h>       //  Click here to get the library: http://librarymanager/All#SparkFun_BME280
#include <SparkFunCCS811.h>       //  Air Quality Index
#include <ClosedCube_HDC1080.h>   //  temp & humidity
#include <Adafruit_SI1145.h>      //  GY-1145 light quality sensor
#include <RTClib.h>               //  RTC library
#include <time.h>                 //  standard time stuff
#include <Adafruit_MPU6050.h>     //  Gyro
#include <Adafruit_TCS34725.h>    //  RGB Sensor

#include <BLEDevice.h>
#include <BLEServer.h>
#include <BLEUtils.h>
#include <BLE2902.h>


//***********************************************************************
#include "Helper.h"               //  my helper header
//  SETUP ***************************************************************
void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);// for debug purposes.
  // Keep power when running from battery
  //bool isOk = setPowerBoostKeepOn(1);
  InitDisplay();
  showBiosInfo();
  scanI2CBus();
  initializeSensorGroup();
  delay(2000);
  ClearScreen();
  infoBlocks();
  MENU_MODE = 0;
  showMenuSystem(MENU_MODE);
  delay(200);
  initMyTouch();
  delay(200);
  clearStatus();
  //BUILTIN LED
  pinMode (2, OUTPUT);
  digitalWrite(2, LOW);
  //touch irq pin
  pinMode (35, INPUT);
  AttachTouch();
}
//  LOOP  *******************************************************************
void loop() {
  //set the BUILTIN_LED off.
  digitalWrite(BUILTIN_LED, LOW);
  // if TouchType is 0 then here is where the actual parsing of the button occurs  - action();
  // first we check for keypress by looking at PAD_DOWN event
  //action(); will invoke the loop
  if (PAD_DOWN && GLOBAL_TOUCH_TYPE == MENU) {
    // at this point to remember is that the interrupt routine
    //just returns the vales to TouchX & TouchY and sets PAD_DOWN = true
    // here we can take the time to analyze x,y and come up with BUTTON_NUMBER
    BUTTON_NUMBER = parseMenuTouch(TouchX , TouchY );
    action(BUTTON_NUMBER);
    PAD_DOWN = false;
  }
  if (PAD_DOWN && GLOBAL_TOUCH_TYPE == NUMERIC) {

    // has a valid entry(number,.,<OK>) been entered?
    GLOBAL_NUMBER = parseForNumber(TouchX, TouchY);
    PAD_DOWN = false;
  }
  // next skip through the loop...anything else you need to loop
  //delay(250);//debounce for now...
  // all of the items you need to run can be done like this...
  // just activate your items one at a time set SystemMode to  1-4.
  if (SystemMode == 0) {
    //display what you need to in your idle loop

  }
  if (SystemMode == TIME) {
    showDateTime();
  }
  if (SystemMode == GYRO) {
    showGyroData();
  }
  if (SystemMode == OXIMETER) {
    //display what you need to in your oxi loop
  }
  if (SystemMode == FLIR) {
    //display what you need to in your FLIR loop
    updateFlirImage();
  }
  if (SystemMode == ENVIRONMENT) {
    //display what you need to in your BME280 loop
    showWeather();
  }
  if (SystemMode == RGB_SCAN) {
    //display what you need to in your BME280 loop
    showRGBReader();
  }
  // and so on...
}// end of loop

ERROR:

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

C:\Users\Xinzhou\Desktop\LS1\3 EYE_clock_game_Stream_health_GPS_sth\00_sth\ESP32_XPT2046_ILI9341_Tmenu_M\ESP32_XPT2046_ILI9341_Tmenu_M.ino: In function 'void loop()':

ESP32_XPT2046_ILI9341_Tmenu_M:133:21: error: 'parseMenuTouch' was not declared in this scope

     BUTTON_NUMBER = parseMenuTouch(TouchX , TouchY );

                     ^~~~~~~~~~~~~~

ESP32_XPT2046_ILI9341_Tmenu_M:134:5: error: 'action' was not declared in this scope

     action(BUTTON_NUMBER);

     ^~~~~~

C:\Users\Xinzhou\Desktop\LS1\3 EYE_clock_game_Stream_health_GPS_sth\00_sth\ESP32_XPT2046_ILI9341_Tmenu_M\ESP32_XPT2046_ILI9341_Tmenu_M.ino:134:5: note: suggested alternative: 'sigaction'

     action(BUTTON_NUMBER);

     ^~~~~~

     sigaction

ESP32_XPT2046_ILI9341_Tmenu_M:166:5: error: 'showWeather' was not declared in this scope

     showWeather();

     ^~~~~~~~~~~

C:\Users\Xinzhou\Desktop\LS1\3 EYE_clock_game_Stream_health_GPS_sth\00_sth\ESP32_XPT2046_ILI9341_Tmenu_M\ESP32_XPT2046_ILI9341_Tmenu_M.ino:166:5: note: suggested alternative: 'showStatus'

     showWeather();

     ^~~~~~~~~~~

     showStatus

ESP32_XPT2046_ILI9341_Tmenu_M:170:5: error: 'showRGBReader' was not declared in this scope

     showRGBReader();

     ^~~~~~~~~~~~~

exit status 1

'parseMenuTouch' was not declared in this scope



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

Thanks.
I searched the library folder and didn't find any.
can it be from: javascript ? because there are few things similar like:

function touchMoved(){
  stroke(255, 0, 0);
  line(touchX, touchY, ptouchX, ptouchY);
  return false;
}

I didn't find a touch only function.

just a simple touch screen menu from this link:

Using the ILI9341 TFT & XPT2046 Touch with ESP32 & Arduino - Hackster.io

actually, the XPT2046_Touchscreen.h do have:

XPT2046_Touchscreen touch(TOUCH_CS);
TS_Point rawLocation;
CCS811 myCCS811(CCS811_ADDR);
ClosedCube_HDC1080 myHDC1080;
BME280 myBME280;
MAX30105 particleSensor;

I don't know why here come up "parseMenuTouch" resulted error.


C:\Users\Xinzhou\Desktop\LS1\3 EYE_clock_game_Stream_health_GPS_sth\00_sth\ESP32_XPT2046_ILI9341_Tmenu_M\ESP32_XPT2046_ILI9341_Tmenu_M.ino: In function 'void loop()':

ESP32_XPT2046_ILI9341_Tmenu_M:133:21: error: 'parseMenuTouch' was not declared in this scope

     BUTTON_NUMBER = parseMenuTouch(TouchX , TouchY );

                     ^~~~~~~~~~~~~~

ESP32_XPT2046_ILI9341_Tmenu_M:134:5: error: 'action' was not declared in this scope

     action(BUTTON_NUMBER);

     ^~~~~~

C:\Users\Xinzhou\Desktop\LS1\3 EYE_clock_game_Stream_health_GPS_sth\00_sth\ESP32_XPT2046_ILI9341_Tmenu_M\ESP32_XPT2046_ILI9341_Tmenu_M.ino:134:5: note: suggested alternative: 'sigaction'

     action(BUTTON_NUMBER);

     ^~~~~~

     sigaction

ESP32_XPT2046_ILI9341_Tmenu_M:166:5: error: 'showWeather' was not declared in this scope

     showWeather();

     ^~~~~~~~~~~

C:\Users\Xinzhou\Desktop\LS1\3 EYE_clock_game_Stream_health_GPS_sth\00_sth\ESP32_XPT2046_ILI9341_Tmenu_M\ESP32_XPT2046_ILI9341_Tmenu_M.ino:166:5: note: suggested alternative: 'showStatus'

     showWeather();

     ^~~~~~~~~~~

     showStatus

ESP32_XPT2046_ILI9341_Tmenu_M:170:5: error: 'showRGBReader' was not declared in this scope

     showRGBReader();

     ^~~~~~~~~~~~~

exit status 1

'parseMenuTouch' was not declared in this scope



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

Read through this section.
Maybe change the functions to the ones suggested?

1 Like

Thank you v205.
I changed what there is suggestion, made some progress, still error: 'parseMenuTouch' was not declared in this scope

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

C:\Users\Xinzhou\Desktop\LS1\3 EYE_clock_game_Stream_health_GPS_sth\00_sth\ESP32_XPT2046_ILI9341_Tmenu_A\ESP32_XPT2046_ILI9341_Tmenu_A.ino: In function 'void loop()':

ESP32_XPT2046_ILI9341_Tmenu_A:132:21: error: 'parseMenuTouch' was not declared in this scope

     BUTTON_NUMBER = parseMenuTouch(TouchX , TouchY );

                     ^~~~~~~~~~~~~~

ESP32_XPT2046_ILI9341_Tmenu_A:135:27: error: too few arguments to function 'int sigaction(int, const sigaction*, sigaction*)'

    sigaction(BUTTON_NUMBER);  /// Suggestiob

                           ^

In file included from c:\users\xinzhou\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r2-patch3\xtensa-esp32-elf\sys-include\signal.h:6,

                 from c:\users\xinzhou\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r2-patch3\xtensa-esp32-elf\sys-include\time.h:178,

                 from C:\Users\Xinzhou\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.5/tools/sdk/esp32/include/newlib/platform_include/time.h:22,

                 from c:\users\xinzhou\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r2-patch3\xtensa-esp32-elf\sys-include\sys\time.h:414,

                 from C:\Users\Xinzhou\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.5/tools/sdk/esp32/include/newlib/platform_include/sys/time.h:16,

                 from C:\Users\Xinzhou\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.5/tools/sdk/esp32/include/newlib/platform_include/pthread.h:18,

                 from c:\users\xinzhou\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r2-patch3\xtensa-esp32-elf\include\c++\8.4.0\xtensa-esp32-elf\no-rtti\bits\gthr-default.h:48,

                 from c:\users\xinzhou\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r2-patch3\xtensa-esp32-elf\include\c++\8.4.0\xtensa-esp32-elf\no-rtti\bits\gthr.h:151,

                 from c:\users\xinzhou\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r2-patch3\xtensa-esp32-elf\include\c++\8.4.0\ext\atomicity.h:35,

                 from c:\users\xinzhou\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r2-patch3\xtensa-esp32-elf\include\c++\8.4.0\bits\basic_string.h:39,

                 from c:\users\xinzhou\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r2-patch3\xtensa-esp32-elf\include\c++\8.4.0\string:52,

                 from c:\users\xinzhou\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r2-patch3\xtensa-esp32-elf\include\c++\8.4.0\stdexcept:39,

                 from c:\users\xinzhou\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r2-patch3\xtensa-esp32-elf\include\c++\8.4.0\array:39,

                 from c:\users\xinzhou\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r2-patch3\xtensa-esp32-elf\include\c++\8.4.0\tuple:39,

                 from c:\users\xinzhou\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r2-patch3\xtensa-esp32-elf\include\c++\8.4.0\functional:54,

                 from C:\Users\Xinzhou\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.5\cores\esp32/HardwareSerial.h:49,

                 from C:\Users\Xinzhou\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.5\cores\esp32/Arduino.h:174,

                 from sketch\ESP32_XPT2046_ILI9341_Tmenu_A.ino.cpp:1:

c:\users\xinzhou\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r2-patch3\xtensa-esp32-elf\sys-include\sys\signal.h:183:5: note: declared here

 int sigaction (int, const struct sigaction *, struct sigaction *);

     ^~~~~~~~~

ESP32_XPT2046_ILI9341_Tmenu_A:168:15: error: too few arguments to function 'void showStatus(String)'

    showStatus();

               ^

In file included from C:\Users\Xinzhou\Desktop\LS1\3 EYE_clock_game_Stream_health_GPS_sth\00_sth\ESP32_XPT2046_ILI9341_Tmenu_A\ESP32_XPT2046_ILI9341_Tmenu_A.ino:94:

C:\Users\Xinzhou\Desktop\LS1\3 EYE_clock_game_Stream_health_GPS_sth\00_sth\ESP32_XPT2046_ILI9341_Tmenu_A\Helper.h:336:6: note: declared here

 void showStatus(String z) {

      ^~~~~~~~~~

ESP32_XPT2046_ILI9341_Tmenu_A:172:5: error: 'showRGBReader' was not declared in this scope

     showRGBReader();

     ^~~~~~~~~~~~~

exit status 1

'parseMenuTouch' was not declared in this scope

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

Thanks.
yes.
2
and when commented out: // BUTTON_NUMBER = parseMenuTouch(TouchX , TouchY );
got another error at the next line: 'action' was not declared in this scope

Is it sigaction?

1 Like

I've tried with 'sigaction' and got error of:
too few arguments to function 'int sigaction(int, const sigaction*, sigaction*)'
and still not yet solve 'parseMenuTouch' problem.

ERROR:

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

E:\ENGINEERING\DIY\Electronic\ESP32\ESP32 GPS LCD map\XPT2046_Touchscreen-master\ESP32TouchMenu_M1\ESP32TouchMenu_M1.ino: In function 'void loop()':

ESP32TouchMenu_M1:137:28: error: too few arguments to function 'int sigaction(int, const sigaction*, sigaction*)'

     sigaction(BUTTON_NUMBER);

                            ^

In file included from c:\users\hua.dellv-pc\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r2-patch5\xtensa-esp32-elf\sys-include\signal.h:6,

                 from c:\users\hua.dellv-pc\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r2-patch5\xtensa-esp32-elf\sys-include\time.h:178,

                 from C:\Users\HUA.DELLV-PC\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.6/tools/sdk/esp32/include/newlib/platform_include/time.h:22,

                 from c:\users\hua.dellv-pc\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r2-patch5\xtensa-esp32-elf\sys-include\sys\time.h:414,

                 from C:\Users\HUA.DELLV-PC\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.6/tools/sdk/esp32/include/newlib/platform_include/sys/time.h:16,

                 from C:\Users\HUA.DELLV-PC\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.6/tools/sdk/esp32/include/newlib/platform_include/pthread.h:18,

                 from c:\users\hua.dellv-pc\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r2-patch5\xtensa-esp32-elf\include\c++\8.4.0\xtensa-esp32-elf\no-rtti\bits\gthr-default.h:48,

                 from c:\users\hua.dellv-pc\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r2-patch5\xtensa-esp32-elf\include\c++\8.4.0\xtensa-esp32-elf\no-rtti\bits\gthr.h:151,

                 from c:\users\hua.dellv-pc\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r2-patch5\xtensa-esp32-elf\include\c++\8.4.0\ext\atomicity.h:35,

                 from c:\users\hua.dellv-pc\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r2-patch5\xtensa-esp32-elf\include\c++\8.4.0\bits\basic_string.h:39,

                 from c:\users\hua.dellv-pc\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r2-patch5\xtensa-esp32-elf\include\c++\8.4.0\string:52,

                 from c:\users\hua.dellv-pc\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r2-patch5\xtensa-esp32-elf\include\c++\8.4.0\stdexcept:39,

                 from c:\users\hua.dellv-pc\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r2-patch5\xtensa-esp32-elf\include\c++\8.4.0\array:39,

                 from c:\users\hua.dellv-pc\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r2-patch5\xtensa-esp32-elf\include\c++\8.4.0\tuple:39,

                 from c:\users\hua.dellv-pc\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r2-patch5\xtensa-esp32-elf\include\c++\8.4.0\functional:54,

                 from C:\Users\HUA.DELLV-PC\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.6\cores\esp32/HardwareSerial.h:49,

                 from C:\Users\HUA.DELLV-PC\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.6\cores\esp32/Arduino.h:174,

                 from sketch\ESP32TouchMenu_M1.ino.cpp:1:

c:\users\hua.dellv-pc\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r2-patch5\xtensa-esp32-elf\sys-include\sys\signal.h:183:5: note: declared here

 int sigaction (int, const struct sigaction *, struct sigaction *);

     ^~~~~~~~~

exit status 1

too few arguments to function 'int sigaction(int, const sigaction*, sigaction*)'



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

Great!
added TinyGsmClient.h done the job.
thank you.

why I didn't find 'no such file' notes .....

What do you mean by that?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.