Error stray '\342' in program

[Please Help Unable to fix this]

Arduino: 1.8.13 (Windows 7), Board: “Arduino Uno”

cap_probe_test:17:13: error: stray ‘\342’ in program

lcd.print(“Moisture Value”);

         ^

cap_probe_test:17:14: error: stray ‘\200’ in program

lcd.print(“Moisture Value”);

          ^

cap_probe_test:17:15: error: stray ‘\234’ in program

lcd.print(“Moisture Value”);

           ^

cap_probe_test:17:30: error: stray ‘\342’ in program

lcd.print(“Moisture Value”);

                          ^

cap_probe_test:17:31: error: stray ‘\200’ in program

lcd.print(“Moisture Value”);

                           ^

cap_probe_test:17:32: error: stray ‘\235’ in program

lcd.print(“Moisture Value”);

                            ^

cap_probe_test:20:13: error: stray ‘\342’ in program

lcd.print(” “);

         ^

cap_probe_test:20:14: error: stray ‘\200’ in program

lcd.print(” “);

          ^

cap_probe_test:20:15: error: stray ‘\235’ in program

lcd.print(” “);

           ^

cap_probe_test:20:17: error: stray ‘\342’ in program

lcd.print(” “);

             ^

cap_probe_test:20:18: error: stray ‘\200’ in program

lcd.print(” “);

              ^

cap_probe_test:20:19: error: stray ‘\234’ in program

lcd.print(” “);

               ^

cap_probe_test:22:13: error: stray ‘\342’ in program

lcd.print(“–“);

         ^

cap_probe_test:22:14: error: stray ‘\200’ in program

lcd.print(“–“);

          ^

cap_probe_test:22:15: error: stray ‘\234’ in program

lcd.print(“–“);

           ^

cap_probe_test:22:16: error: stray ‘\342’ in program

lcd.print(“–“);

            ^

cap_probe_test:22:17: error: stray ‘\200’ in program

lcd.print(“–“);

             ^

cap_probe_test:22:18: error: stray ‘\223’ in program

lcd.print(“–“);

              ^

cap_probe_test:22:19: error: stray ‘\342’ in program

lcd.print(“–“);

               ^

cap_probe_test:22:20: error: stray ‘\200’ in program

lcd.print(“–“);

                ^

cap_probe_test:22:21: error: stray ‘\234’ in program

lcd.print(“–“);

                 ^

cap_probe_test:26:13: error: stray ‘\342’ in program

lcd.print(“%”);

         ^

cap_probe_test:26:14: error: stray ‘\200’ in program

lcd.print(“%”);

          ^

cap_probe_test:26:15: error: stray ‘\234’ in program

lcd.print(“%”);

           ^

cap_probe_test:26:17: error: stray ‘\342’ in program

lcd.print(“%”);

             ^

cap_probe_test:26:18: error: stray ‘\200’ in program

lcd.print(“%”);

              ^

cap_probe_test:26:19: error: stray ‘\235’ in program

lcd.print(“%”);

               ^

cap_probe_test:27:13: error: stray ‘\342’ in program

lcd.print(” “);

         ^

cap_probe_test:27:14: error: stray ‘\200’ in program

lcd.print(” “);

          ^

cap_probe_test:27:15: error: stray ‘\235’ in program

lcd.print(” “);

           ^

cap_probe_test:27:17: error: stray ‘\342’ in program

lcd.print(” “);

             ^

cap_probe_test:27:18: error: stray ‘\200’ in program

lcd.print(” “);

              ^

cap_probe_test:27:19: error: stray ‘\234’ in program

lcd.print(” “);

               ^

C:\Users\Robi\Documents\Arduino Projects\cap_probe_test\cap_probe_test.ino: In function ‘void setup()’:

cap_probe_test:9:7: error: ‘class LiquidCrystal_I2C’ has no member named ‘init’

lcd.init();

   ^~~~

C:\Users\Robi\Documents\Arduino Projects\cap_probe_test\cap_probe_test.ino: In function ‘void loop()’:

cap_probe_test:17:16: error: ‘Moisture’ was not declared in this scope

lcd.print(“Moisture Value”);

            ^~~~~~~~

C:\Users\Robi\Documents\Arduino Projects\cap_probe_test\cap_probe_test.ino:17:16: note: suggested alternative: ‘dtostre’

lcd.print(“Moisture Value”);

            ^~~~~~~~

            dtostre

cap_probe_test:20:20: error: no matching function for call to ‘LiquidCrystal_I2C::print()’

lcd.print(” “);

                ^

In file included from C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Stream.h:26:0,

             from C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h:29,

             from C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:233,

             from sketch\cap_probe_test.ino.cpp:1:

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:65:12: note: candidate: size_t Print::print(const __FlashStringHelper*)

 size_t print(const __FlashStringHelper *);

        ^~~~~

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:65:12: note: candidate expects 1 argument, 0 provided

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:66:12: note: candidate: size_t Print::print(const String&)

 size_t print(const String &);

        ^~~~~

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:66:12: note: candidate expects 1 argument, 0 provided

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:67:12: note: candidate: size_t Print::print(const char*)

 size_t print(const char[]);

        ^~~~~

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:67:12: note: candidate expects 1 argument, 0 provided

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:68:12: note: candidate: size_t Print::print(char)

 size_t print(char);

        ^~~~~

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:68:12: note: candidate expects 1 argument, 0 provided

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:69:12: note: candidate: size_t Print::print(unsigned char, int)

 size_t print(unsigned char, int = DEC);

        ^~~~~

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:69:12: note: candidate expects 2 arguments, 0 provided

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:70:12: note: candidate: size_t Print::print(int, int)

 size_t print(int, int = DEC);

        ^~~~~

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:70:12: note: candidate expects 2 arguments, 0 provided

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:71:12: note: candidate: size_t Print::print(unsigned int, int)

 size_t print(unsigned int, int = DEC);

        ^~~~~

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:71:12: note: candidate expects 2 arguments, 0 provided

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:72:12: note: candidate: size_t Print::print(long int, int)

 size_t print(long, int = DEC);

        ^~~~~

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:72:12: note: candidate expects 2 arguments, 0 provided

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:73:12: note: candidate: size_t Print::print(long unsigned int, int)

 size_t print(unsigned long, int = DEC);

        ^~~~~

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:73:12: note: candidate expects 2 arguments, 0 provided

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:74:12: note: candidate: size_t Print::print(double, int)

 size_t print(double, int = 2);

        ^~~~~

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:74:12: note: candidate expects 2 arguments, 0 provided

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:75:12: note: candidate: size_t Print::print(const Printable&)

 size_t print(const Printable&);

        ^~~~~

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:75:12: note: candidate expects 1 argument, 0 provided

cap_probe_test:22:22: error: no matching function for call to ‘LiquidCrystal_I2C::print()’

lcd.print(“–“);

                  ^

In file included from C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Stream.h:26:0,

             from C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h:29,

             from C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:233,

             from sketch\cap_probe_test.ino.cpp:1:

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:65:12: note: candidate: size_t Print::print(const __FlashStringHelper*)

 size_t print(const __FlashStringHelper *);

        ^~~~~

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:65:12: note: candidate expects 1 argument, 0 provided

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:66:12: note: candidate: size_t Print::print(const String&)

 size_t print(const String &);

        ^~~~~

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:66:12: note: candidate expects 1 argument, 0 provided

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:67:12: note: candidate: size_t Print::print(const char*)

 size_t print(const char[]);

        ^~~~~

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:67:12: note: candidate expects 1 argument, 0 provided

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:68:12: note: candidate: size_t Print::print(char)

 size_t print(char);

        ^~~~~

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:68:12: note: candidate expects 1 argument, 0 provided

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:69:12: note: candidate: size_t Print::print(unsigned char, int)

 size_t print(unsigned char, int = DEC);

        ^~~~~

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:69:12: note: candidate expects 2 arguments, 0 provided

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:70:12: note: candidate: size_t Print::print(int, int)

 size_t print(int, int = DEC);

        ^~~~~

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:70:12: note: candidate expects 2 arguments, 0 provided

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:71:12: note: candidate: size_t Print::print(unsigned int, int)

 size_t print(unsigned int, int = DEC);

        ^~~~~

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:71:12: note: candidate expects 2 arguments, 0 provided

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:72:12: note: candidate: size_t Print::print(long int, int)

 size_t print(long, int = DEC);

        ^~~~~

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:72:12: note: candidate expects 2 arguments, 0 provided

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:73:12: note: candidate: size_t Print::print(long unsigned int, int)

 size_t print(unsigned long, int = DEC);

        ^~~~~

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:73:12: note: candidate expects 2 arguments, 0 provided

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:74:12: note: candidate: size_t Print::print(double, int)

 size_t print(double, int = 2);

        ^~~~~

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:74:12: note: candidate expects 2 arguments, 0 provided

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:75:12: note: candidate: size_t Print::print(const Printable&)

 size_t print(const Printable&);

        ^~~~~

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:75:12: note: candidate expects 1 argument, 0 provided

cap_probe_test:26:16: error: expected primary-expression before ‘%’ token

lcd.print(“%”);

            ^

cap_probe_test:26:20: error: expected primary-expression before ‘)’ token

lcd.print(“%”);

                ^

cap_probe_test:27:20: error: no matching function for call to ‘LiquidCrystal_I2C::print()’

lcd.print(” “);

                ^

In file included from C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Stream.h:26:0,

             from C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h:29,

             from C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:233,

             from sketch\cap_probe_test.ino.cpp:1:

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:65:12: note: candidate: size_t Print::print(const __FlashStringHelper*)

 size_t print(const __FlashStringHelper *);

        ^~~~~

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:65:12: note: candidate expects 1 argument, 0 provided

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:66:12: note: candidate: size_t Print::print(const String&)

 size_t print(const String &);

        ^~~~~

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:66:12: note: candidate expects 1 argument, 0 provided

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:67:12: note: candidate: size_t Print::print(const char*)

 size_t print(const char[]);

        ^~~~~

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:67:12: note: candidate expects 1 argument, 0 provided

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:68:12: note: candidate: size_t Print::print(char)

 size_t print(char);

        ^~~~~

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:68:12: note: candidate expects 1 argument, 0 provided

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:69:12: note: candidate: size_t Print::print(unsigned char, int)

 size_t print(unsigned char, int = DEC);

        ^~~~~

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:69:12: note: candidate expects 2 arguments, 0 provided

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:70:12: note: candidate: size_t Print::print(int, int)

 size_t print(int, int = DEC);

        ^~~~~

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:70:12: note: candidate expects 2 arguments, 0 provided

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:71:12: note: candidate: size_t Print::print(unsigned int, int)

 size_t print(unsigned int, int = DEC);

        ^~~~~

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:71:12: note: candidate expects 2 arguments, 0 provided

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:72:12: note: candidate: size_t Print::print(long int, int)

 size_t print(long, int = DEC);

        ^~~~~

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:72:12: note: candidate expects 2 arguments, 0 provided

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:73:12: note: candidate: size_t Print::print(long unsigned int, int)

 size_t print(unsigned long, int = DEC);

        ^~~~~

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:73:12: note: candidate expects 2 arguments, 0 provided

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:74:12: note: candidate: size_t Print::print(double, int)

 size_t print(double, int = 2);

        ^~~~~

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:74:12: note: candidate expects 2 arguments, 0 provided

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:75:12: note: candidate: size_t Print::print(const Printable&)

 size_t print(const Printable&);

        ^~~~~

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Print.h:75:12: note: candidate expects 1 argument, 0 provided

exit status 1

stray ‘\342’ in program

This report would have more information with
“Show verbose output during compilation”
option enabled in File → Preferences.

Did you post the code that is producing those errors ?

Hi

Yes, under Error stray \342 in program

Yep, here is the code:

#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd (0x27, 16, 2);
#define sensor A2
#define wet 210
#define dry 510

void setup() {
Serial.begin(9600);
lcd.init();
lcd.backlight();
}

void loop() {
int value = analogRead(sensor);
Serial.println(value);
lcd.setCursor(1, 0);
lcd.print(“Moisture Value”);
lcd.setCursor(3, 1);
lcd.print(value);
lcd.print(” “);
lcd.setCursor(7,1);
lcd.print(“–“);
int pre = map(value, wet, dry, 100, 0);
lcd.setCursor(10, 1);
lcd.print(pre);
lcd.print(“%”);
lcd.print(” “);
}

Check all these symbols ".
If you copied this sketch from somewhere they can be wrong.
It should be quoted ".

Look at the difference " and ” .
RV mineirin

Did you copy the program from the web, then paste it in the IDE?
If yes, paste it in notepad then copy it again.

Find and replace in the IDE fixes these problems. i.e. Find ” and replace "

Thanks, I now get what you mean, its the quotes, that were wrong (in unicode) I did copy and then pasted it into the IDE.