Please debug T T

I’m a beginner and i got this error and still not declared in the scope
please I need you helps thank you

#include <LiquidCrystal.h> 
#include <SoftwareSerial.h> 
#include <TinyGPS.h> 
float lat = 28.5458,lon = 77.1703; // create variable for latitude and longitude object  
SoftwareSerial gpsSerial(3,4);//rx,tx



TinyGPS gps; // create gps object 

void setup(){ 

LiquidCrystal lcd(A0,A1,A2,A3,A4,A5); 
Serial.begin(9600); // connect serial 
//Serial.println("The GPS Received Signal:"); 
gpsSerial.begin(9600); // connect gps sensor 
lcd.begin(16,2); 
} 

void loop(){ 
  while(gpsSerial.available()){ // check for gps data 
  if(gps.encode(gpsSerial.read()))// encode gps data 
  {  
  gps.f_get_position(&lat,&lon); // get latitude and longitude 
  // display position 
  lcd.clear(); 
  lcd.setCursor(1,0); 
  lcd.print("GPS Signal"); 
  //Serial.print("Position: "); 
  //Serial.print("Latitude:"); 
  //Serial.print(lat,6); 
  //Serial.print(";"); 
  //Serial.print("Longitude:"); 
  //Serial.println(lon,6);  
  lcd.setCursor(1,0); 
  lcd.print("LAT:"); 
  lcd.setCursor(5,0); 
  lcd.print(lat); 
  //Serial.print(lat); 
  //Serial.print(" "); 
  lcd.setCursor(0,1); 
  lcd.print(",LON:"); 
  lcd.setCursor(5,1); 
  lcd.print(lon); 
 } 
} 
String latitude = String(lat,6); 
  String longitude = String(lon,6); 
Serial.println(latitude+";"+longitude); 
delay(1000); 
}

ERROR


sketch_sep30a:8:22: error: 'A1' was not declared in this scope

 LiquidCrystal lcd(A0,A1,A2,A3,A4,A5); 

                      ^

sketch_sep30a:8:25: error: 'A2' was not declared in this scope

 LiquidCrystal lcd(A0,A1,A2,A3,A4,A5); 

                         ^

C:\Users\Pangko\Desktop\arduino\Pull_project\sketch_sep30a\sketch_sep30a.ino: In function 'void setup()':

sketch_sep30a:11:22: error: 'A1' was not declared in this scope

 LiquidCrystal lcd(A0,A1,A2,A3,A4,A5); 

                      ^

sketch_sep30a:11:25: error: 'A2' was not declared in this scope

 LiquidCrystal lcd(A0,A1,A2,A3,A4,A5); 

                         ^

exit status 1
'A1' was not declared in this scope

Moderator edit:
</mark> <mark>[code]</mark> <mark>

</mark> <mark>[/code]</mark> <mark>
tags added. Illegible coloring removed.

Please use code tags (</> button on the toolbar) when you post code or warning/error messages. The reason is that the forum software can interpret parts of your code as markup, leading to confusion, wasted time, and a reduced chance for you to get help with your problem. This will also make it easier to read your code and to copy it to the IDE or editor. If your browser doesn’t show the posting toolbar then you can just manually add the code tags:
[code]``[color=blue]// your code is here[/color]``[/code]
Using code tags and other important information is explained in the How to use this forum post. Please read it.

Which board do you have selected from the Tools > Board menu.

What's the point of defining lcd inside setup?

This line

LiquidCrystal lcd(A0,A1,A2,A3,A4,A5);

should be before setup()

What Arduino board are you using?

...R

The A0, A1, A2... should be declared in Arduino.h. Did you accidentally use a .cpp extension on your filename instead of .ino?

pert:
Please use code tags (</> button on the toolbar) when you post code or warning/error messages. The reason is that the forum software can interpret parts of your code as markup, leading to confusion, wasted time, and a reduced chance for you to get help with your problem. This will also make it easier to read your code and to copy it to the IDE or editor. If your browser doesn’t show the posting toolbar then you can just manually add the code tags:
[code]``[color=blue]// your code is here[/color]``[/code]
Using code tags and other important information is explained in the How to use this forum post. Please read it.

Which board do you have selected from the Tools > Board menu.

Ok sir I’m really sorry and thank you for advice

I do not understand where I can get the library. I already have softwareserial and still required interrupt.h io.h many files and finally get these error so what did I do wrong? I’m not good at English Plz I need help i got stuck with this for a week :frowning:

I want to get latitude and longitude.
My board is ESP32 doit devkit v1 and GPS gy-neo6m

this is my code

#include <SoftwareSerial.h>


SoftwareSerial gpsSerial(10, 11); // RX, TX (TX not used)
const int sentenceSize = 80;

char sentence[sentenceSize];

void setup()
{
  Serial.begin(9600);
  gpsSerial.begin(9600);
}

void loop()
{
  static int i = 0;
  if (gpsSerial.available())
  {
    char ch = gpsSerial.read();
    if (ch != '\n' && i < sentenceSize)
    {
      sentence[i] = ch;
      i++;
    }
    else
    {
     sentence[i] = '\0';
     i = 0;
     displayGPS();
    }
  }
}

void displayGPS()
{
  char field[20];
  getField(field, 0);
  if (strcmp(field, "$GPRMC") == 0)
  {
    Serial.print("Lat: ");
    getField(field, 3);  // number
    Serial.print(field);
    getField(field, 4); // N/S
    Serial.print(field);
    
    Serial.print(" Long: ");
    getField(field, 5);  // number
    Serial.print(field);
    getField(field, 6);  // E/W
    Serial.println(field);
  }
}

void getField(char* buffer, int index)
{
  int sentencePos = 0;
  int fieldPos = 0;
  int commaCount = 0;
  while (sentencePos < sentenceSize)
  {
    if (sentence[sentencePos] == ',')
    {
      commaCount ++;
      sentencePos ++;
    }
    if (commaCount == index)
    {
      buffer[fieldPos] = sentence[sentencePos];
      fieldPos ++;
    }
    sentencePos ++;
  }
  buffer[fieldPos] = '\0';
}

This is my error code

In file included from C:\Users\Pangko\Documents\Arduino\libraries\SoftwareSerial/avr/pgmspace.h:87:0,

                 from C:\Users\Pangko\Documents\Arduino\libraries\SoftwareSerial\SoftwareSerial.cpp:42:

C:\Users\Pangko\Documents\Arduino\hardware\espressif\esp32/tools/sdk/include/newlib/inttypes.h:22:0: warning: "__STRINGIFY" redefined

 #define __STRINGIFY(a) #a

 ^

In file included from C:\Users\Pangko\Documents\Arduino\libraries\SoftwareSerial\SoftwareSerial.cpp:41:0:

C:\Users\Pangko\Documents\Arduino\libraries\SoftwareSerial/avr/interrupt.h:42:0: note: this is the location of the previous definition

 #define __STRINGIFY(x) #x

 ^
   #define pgm_read_byte(address_short)    pgm_read_byte_near(address_short)

 ^

In file included from C:\Users\Pangko\Documents\Arduino\hardware\espressif\esp32\cores\esp32/WString.h:29:0,

                 from C:\Users\Pangko\Documents\Arduino\hardware\espressif\esp32\cores\esp32/Arduino.h:152,

                 from C:\Users\Pangko\Documents\Arduino\libraries\SoftwareSerial\SoftwareSerial.cpp:43:

C:\Users\Pangko\Documents\Arduino\hardware\espressif\esp32\cores\esp32/pgmspace.h:40:0: warning: "pgm_read_word" redefined

 #define pgm_read_word(addr) ({ \

 ^

In file included from C:\Users\Pangko\Documents\Arduino\libraries\SoftwareSerial\SoftwareSerial.cpp:42:0:

C:\Users\Pangko\Documents\Arduino\libraries\SoftwareSerial/avr/pgmspace.h:988:0: note: this is the location of the previous definition

   #define pgm_read_word(address_short)    pgm_read_word_near(address_short)

 ^

In file included from C:\Users\Pangko\Documents\Arduino\hardware\espressif\esp32\cores\esp32/WString.h:29:0,

                 from C:\Users\Pangko\Documents\Arduino\hardware\espressif\esp32\cores\esp32/Arduino.h:152,

                 from C:\Users\Pangko\Documents\Arduino\libraries\SoftwareSerial\SoftwareSerial.cpp:43:

C:\Users\Pangko\Documents\Arduino\hardware\espressif\esp32\cores\esp32/pgmspace.h:44:0: warning: "pgm_read_dword" redefined

 #define pgm_read_dword(addr) ({ \

 ^

In file included from C:\Users\Pangko\Documents\Arduino\libraries\SoftwareSerial\SoftwareSerial.cpp:42:0:

C:\Users\Pangko\Documents\Arduino\libraries\SoftwareSerial/avr/pgmspace.h:996:0: note: this is the location of the previous definition

   #define pgm_read_dword(address_short)   pgm_read_dword_near(address_short)

 ^

In file included from C:\Users\Pangko\Documents\Arduino\hardware\espressif\esp32\cores\esp32/WString.h:29:0,

                 from C:\Users\Pangko\Documents\Arduino\hardware\espressif\esp32\cores\esp32/Arduino.h:152,

                 from C:\Users\Pangko\Documents\Arduino\libraries\SoftwareSerial\SoftwareSerial.cpp:43:

C:\Users\Pangko\Documents\Arduino\hardware\espressif\esp32\cores\esp32/pgmspace.h:48:0: warning: "pgm_read_float" redefined

 #define pgm_read_float(addr) ({ \

 ^

In file included from C:\Users\Pangko\Documents\Arduino\libraries\SoftwareSerial\SoftwareSerial.cpp:42:0:

C:\Users\Pangko\Documents\Arduino\libraries\SoftwareSerial/avr/pgmspace.h:1005:0: note: this is the location of the previous definition

   #define pgm_read_float(address_short)   pgm_read_float_near(address_short)

 ^

In file included from C:\Users\Pangko\Documents\Arduino\hardware\espressif\esp32\cores\esp32/WString.h:29:0,

                 from C:\Users\Pangko\Documents\Arduino\hardware\espressif\esp32\cores\esp32/Arduino.h:152,

                 from C:\Users\Pangko\Documents\Arduino\libraries\SoftwareSerial\SoftwareSerial.cpp:43:

C:\Users\Pangko\Documents\Arduino\hardware\espressif\esp32\cores\esp32/pgmspace.h:52:0: warning: "pgm_read_ptr" redefined

 #define pgm_read_ptr(addr) ({ \

 ^


C:\Users\Pangko\Documents\Arduino\hardware\espressif\esp32/tools/sdk/include/soc/soc/gpio_struct.h:202:13: error: 'uint32_t' does not name a type

             uint32_t oen_inv_sel:  1;               /*invert the output enable value  if you want to revert the output enable value  setting the value to 1*/

             ^

C:\Users\Pangko\Documents\Arduino\hardware\espressif\esp32/tools/sdk/include/soc/soc/gpio_struct.h:203:13: error: 'uint32_t' does not name a type

             uint32_t reserved12:  20;               /*The 40 registers below are selection control for 40 GPIO output  if GPIO_FUNCx_OUT_SEL is set to n(0<=n<256): it means GPIOn input is used for output signal x  if GPIO_FUNCx_OUT_INV_SEL is set to 1  the output signal x is set to ~value.  if GPIO_FUNC0_OUT_SEL is 256 or GPIO_FUNC0_OEN_SEL is 1 using GPIO_ENABLE_DATA[x] for the enable value else using the signal enable*/

             ^

C:\Users\Pangko\Documents\Arduino\hardware\espressif\esp32/tools/sdk/include/soc/soc/gpio_struct.h:205:9: error: 'uint32_t' does not name a type

         uint32_t val;

         ^

In file included from C:\Users\Pangko\Documents\Arduino\hardware\espressif\esp32/tools/sdk/include/driver/driver/gpio.h:22:0,

                 from C:\Users\Pangko\Documents\Arduino\hardware\espressif\esp32/tools/sdk/include/esp32/esp_sleep.h:19,

                 from C:\Users\Pangko\Documents\Arduino\hardware\espressif\esp32/tools/sdk/include/esp32/esp_system.h:21,

                 from C:\Users\Pangko\Documents\Arduino\hardware\espressif\esp32/tools/sdk/include/freertos/freertos/portable.h:126,

                 from C:\Users\Pangko\Documents\Arduino\hardware\espressif\esp32/tools/sdk/include/freertos/freertos/FreeRTOS.h:105,

                 from C:\Users\Pangko\Documents\Arduino\hardware\espressif\esp32\cores\esp32/Arduino.h:32,

                 from C:\Users\Pangko\Documents\Arduino\libraries\SoftwareSerial\SoftwareSerial.cpp:43:

C:\Users\Pangko\Documents\Arduino\hardware\espressif\esp32/tools/sdk/include/soc/soc/io_mux_reg.h:93:64: error: variable or field 'PIN_PULLUP_DIS' declared void

 static inline void __attribute__ ((deprecated)) PIN_PULLUP_DIS(uint32_t PIN_NAME) 

                                                                ^

C:\Users\Pangko\Documents\Arduino\hardware\espressif\esp32/tools/sdk/include/soc/soc/io_mux_reg.h:93:64: error: 'uint32_t' was not declared in this scope

In file included from c:\users\pangko\documents\arduino\hardware\espressif\esp32\tools\xtensa-esp32-elf\xtensa-esp32-elf\include\c++\5.2.0\utility:75:0,

                 from c:\users\pangko\documents\arduino\hardware\espressif\esp32\tools\xtensa-esp32-elf\xtensa-esp32-elf\include\c++\5.2.0\algorithm:60,

                 from C:\Users\Pangko\Documents\Arduino\hardware\espressif\esp32\cores\esp32/Arduino.h:148,

                 from C:\Users\Pangko\Documents\Arduino\libraries\SoftwareSerial\SoftwareSerial.cpp:43:

c:\users\pangko\documents\arduino\hardware\espressif\esp32\tools\xtensa-esp32-elf\xtensa-esp32-elf\include\c++\5.2.0\initializer_list:39:37: error: expected '}' before end of line

c:\users\pangko\documents\arduino\hardware\espressif\esp32\tools\xtensa-esp32-elf\xtensa-esp32-elf\include\c++\5.2.0\initializer_list:39:37: error: expected '}' before end of line

c:\users\pangko\documents\arduino\hardware\espressif\esp32\tools\xtensa-esp32-elf\xtensa-esp32-elf\include\c++\5.2.0\initializer_list:39:37: error: expected declaration before end of line

exit status 1
Error compiling for board DOIT ESP32 DEVKIT V1.

this is only 1 of 4 error parts

The board definition for the DOIT ESP32 DEVKIT V1 doesn't have pins A1 or A2: https://github.com/espressif/arduino-esp32/blob/master/variants/doitESP32devkitV1/pins_arduino.h#L28-L43

static const uint8_t A0 = 36;
static const uint8_t A3 = 39;
static const uint8_t A4 = 32;
static const uint8_t A5 = 33;
static const uint8_t A6 = 34;
static const uint8_t A7 = 35;
static const uint8_t A10 = 4;
static const uint8_t A11 = 0;
static const uint8_t A12 = 2;
static const uint8_t A13 = 15;
static const uint8_t A14 = 13;
static const uint8_t A15 = 12;
static const uint8_t A16 = 14;
static const uint8_t A17 = 27;
static const uint8_t A18 = 25;
static const uint8_t A19 = 26;

My advice is to use the digital pin numbers as marked on the board.

ansme: ``` [code] sketch_sep30a:8:22: error: 'A1' was not declared in this scope

LiquidCrystal lcd(A0,A1,A2,A3,A4,A5);

                      ^

sketch_sep30a:8:25: error: 'A2' was not declared in this scope

LiquidCrystal lcd(A0,A1,A2,A3,A4,A5);

                        ^

ansme:
I do not understand where I can get the library.

Which library?

ansme:
I already have softwareserial and still required interrupt.h io.h many files and finally get these error so what did I do wrong?

Likely you’re compiling code that is not compatible with the ESP32. You need to understand that a lot of the libraries, example sketches, tutorials, etc. are written for the popular AVR-based Arduino boards. When you use a non-AVR board, such as your DOIT ESP32 DEVKIT V1, things get more complicated, especially for a beginner. It’s not impossible but you’re going to work harder and have perseverance to achieve success.

ansme:
this is only 1 of 4 error parts

When you encounter an error you’ll see a button on the right side of the orange bar “Copy error messages”. Click that button. Paste the error in a message here USING CODE TAGS (</> button on the toolbar).

pert:
Which library?

SoftwareSerial library
#include <SoftwareSerial.h>

I have problems with this library. I will get these error all the time when I include softwareserial.h
I do not know what to do next. How could I solve these error? or I should get another board that support wifi? advice me please Thank you.

Error reports here

:Doit ESP32 Devkit Board : Gy-neo6mv2 GPS module
This code

#include <SoftwareSerial.h>
#include <TinyGPS++.h>
SoftwareSerial gpsSerial(4,2); 
TinyGPSPlus gps;
float lattitude,longitude;
void setup() {
 gpsSerial.begin(9600);
 Serial.begin(9600); 
  }
void loop()
{
  while (gpsSerial.available())
  {
    int data = gpsSerial.read();
    if (gps.encode(data))
    {
      lattitude = (gps.location.lat());
      longitude = (gps.location.lng());
      Serial.print ("lattitude: ");
      Serial.println (lattitude);
      Serial.print ("longitude: ");
      Serial.println (longitude);
    }
  }
}

Probably because the library is not compatible with the ESP32. The ESP32 has multiple hardware serial ports. You don't need to use software serial.

Hi, Have you googled.

esp32 neo6m

esp32 LCD display

Tom... :)

pert: You don't need to use software serial.

If these library not working so what library can I use? I learn more manything that you teach me. I've tried manything and finally I get back to basic LED blink then found this error. (the blink code is working at the first time )

C:\Users\Pangko\Documents\Arduino\hardware\espressif\esp32/tools/sdk/lib\libdriver.a(uart.o):(.literal.uart_flush_input+0x8): undefined reference to `vRingbufferReturnItem'

C:\Users\Pangko\Documents\Arduino\hardware\espressif\esp32/tools/sdk/lib\libdriver.a(uart.o):(.literal.uart_flush_input+0xc): undefined reference to `xRingbufferReceive'

C:\Users\Pangko\Documents\Arduino\hardware\espressif\esp32/tools/sdk/lib\libdriver.a(uart.o):(.literal.uart_flush_input+0x10): undefined reference to `xRingbufferSend'

C:\Users\Pangko\Documents\Arduino\hardware\espressif\esp32/tools/sdk/lib\libdriver.a(uart.o): In function `uart_flush_input':

/Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/driver/uart.c:1246: undefined reference to `vRingbufferReturnItem'

/Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/driver/uart.c:1253: undefined reference to `xRingbufferReceive'

/Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/driver/uart.c:1270: undefined reference to `vRingbufferReturnItem'

/Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/driver/uart.c:1271: undefined reference to `xRingbufferSend'

collect2.exe: error: ld returned 1 exit status

exit status 1

every time before replying. I've serach google but I do not found way to solve it.

TomGeorge: Have you googled. esp32 neo6m esp32 LCD display

Yes. I'm following step by step gps not working but my st-00008 and esp32 connecting to wifi are working normally.

Ok thank you Sir

pert: You don't need to use software serial.

OK sir Thank you so much. It''s work now : )

I'm glad to hear it's working now. Enjoy! Per