Unknown error for arduino 1.8.19

Every time i want to compile normally this unknown error happens

Arduino: 1.8.19 (Windows 10), Board: "Arduin

In file included from C:\Users\Omar Sowwan\OneDrive\���������\Arduino\libraries\DHT-sensor-library-master\DHT_U.cpp:15:0:

C:\Users\Omar Sowwan\OneDrive\���������\Arduino\libraries\DHT-sensor-library-master\DHT_U.h:36:10: fatal error: Adafruit_Sensor.h: No such file or directory

 #include <Adafruit_Sensor.h>
          ^~~~~~~~~~~~~~~~~~~

compilation terminated.

exit status 1

Error compiling for board Arduino Uno.

And here is my code:

/*
 
SOLAR SET OF SENSORS 
Temperature sensor, humidity sensor, light sensor, soil moisture sensor
DHT11/22, LDR, FC-28-B

*/

#include <DHT.h>
#include <Wire.h> 
#include <LCD.h>
#include <LiquidCrystal_I2C.h>
#include <RBD_LightSensor.h>

//Constants
#define DHTPIN 4          //DHT PIN ON ARDUINO PIN 4  
#define DHTTYPE DHT11     //IF YOU HAVE DHT22 THEN RENAME DHT11 TO DHT22
DHT dht(DHTPIN, DHTTYPE);  

#define I2C_ADDR 0x3F           //0X3F IS THE ADDRESS OF LCD SCREEN
#define BACKLIGHT_PIN 3
#define En_pin 2
#define Rw_pin 1
#define Rs_pin 0
#define D4_pin 4
#define D5_pin 5
#define D6_pin 6
#define D7_pin 7
LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);

//Variables
int chk;
float hum;  //HUMIDITY VALUE
float temp; //TEMPERATURE VALUE

int soil_sensor_pin = A1;    //SOIL MOISTRURE SENSOR A0 PIN IS CONNECTED TO ARDUINO PIN A1
float soil_output; //SOIL MOISTURE VALUE

RBD::LightSensor light_sensor(A0);  //PHOTORESISTOR IS CONNECTED TO ARDUINO PIN A0

void setup()
{
  Serial.begin(115200);        //START SERIAL MONITOR
  dht.begin();                 //START DHT SENSOR
  lcd.begin(16,2);             //START LCD SCREEN
  lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE);
  lcd.setBacklight(HIGH);      //TURN ON THE LCD BACKLIGHT
}

void loop()
{

  //READING VALUES ONCE ON START OF THE LOOP BECAUSE TRANSFERING DATA DRAINS BATTERY MORE

  hum = dht.readHumidity();    //READ HUMIDITY VALUE
  temp = dht.readTemperature();  //READ TEMPERATURE VALUE
  soil_output = analogRead(soil_sensor_pin); //READ SOIL MOISTURE VALUE
  soil_output = map(soil_output,550,0,0,100); //CONVERT IT TO % VALUE
  
  Serial.print("Humidity: ");
  Serial.print(hum);
  Serial.print(" %, Temp: ");
  Serial.print(temp);
  Serial.println(" Celsius");                                //PRINT VALUES ON SERIAL MONITOR
  Serial.print("Light: ");
  Serial.println(light_sensor.getPercentValue());
  Serial.print("Soil moisture: ");
  Serial.print(soil_output);
  Serial.println("%");
  
  
  
  //PRINT VALUES ON LCD SCREEN

  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("Temperature:");
  lcd.setCursor(0,1);
  lcd.print(temp);                    
  lcd.print(" ");
  lcd.print((char)223);
  lcd.print("C");

  delay(4000);

  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("Humidity:");
  lcd.setCursor(0,1);
  lcd.print(hum);
  lcd.print("%");

  delay(4000); //Delay 2 sec.

  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("Soil moisture:");
  lcd.setCursor(0,1);
  lcd.print(soil_output);
  lcd.print("%");

  delay(4000);

  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("Light:");
  lcd.setCursor(0,1);
  lcd.print(light_sensor.getPercentValue());
  lcd.print("%");
  
  delay(4000);

}

May be it does not like some of the characters in the path ➜ change the ��������� to something in ASCII, with no spaces

the probloem is i dont have any folder called like this

it was documents folder @J-M-L
nothing special

why does it show as ��������� ?

1 Like

idk @J-M-L
i think because this :fatal error: Adafruit_Sensor.h: No such file or directory
#include <Adafruit_Sensor.h>

did you install the Adafruit_Sensor libraries and where ?

@J-M-L


in the same directory: 
C:\Users\Omar Sowwan\OneDrive\المستندات\Arduino\libraries\Adafruit_Sensor-master

and i got a very large error:Arduino: 1.8.19 (Windows 10), Board: "Arduino Uno"





















FET3S5PJHATN1NF:33:80: error: no matching function for call to 'LiquidCrystal_I2C::LiquidCrystal_I2C(int, int, int, int, int, int, int, int)'

 LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);

                                                                                ^

In file included from C:\Users\Omar Sowwan\Downloads\FET3S5PJHATN1NF\FET3S5PJHATN1NF.ino:16:0:

C:\Users\Omar Sowwan\OneDrive\���������\Arduino\libraries\Arduino-LiquidCrystal-I2C-library-master/LiquidCrystal_I2C.h:71:2: note: candidate: LiquidCrystal_I2C::LiquidCrystal_I2C(uint8_t, uint8_t, uint8_t, uint8_t)

  LiquidCrystal_I2C(uint8_t lcd_addr, uint8_t lcd_cols, uint8_t lcd_rows, uint8_t charsize = LCD_5x8DOTS);

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

C:\Users\Omar Sowwan\OneDrive\���������\Arduino\libraries\Arduino-LiquidCrystal-I2C-library-master/LiquidCrystal_I2C.h:71:2: note:   candidate expects 4 arguments, 8 provided

C:\Users\Omar Sowwan\OneDrive\���������\Arduino\libraries\Arduino-LiquidCrystal-I2C-library-master/LiquidCrystal_I2C.h:60:7: note: candidate: constexpr LiquidCrystal_I2C::LiquidCrystal_I2C(const LiquidCrystal_I2C&)

 class LiquidCrystal_I2C : public Print {

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

C:\Users\Omar Sowwan\OneDrive\���������\Arduino\libraries\Arduino-LiquidCrystal-I2C-library-master/LiquidCrystal_I2C.h:60:7: note:   candidate expects 1 argument, 8 provided

C:\Users\Omar Sowwan\OneDrive\���������\Arduino\libraries\Arduino-LiquidCrystal-I2C-library-master/LiquidCrystal_I2C.h:60:7: note: candidate: constexpr LiquidCrystal_I2C::LiquidCrystal_I2C(LiquidCrystal_I2C&&)

C:\Users\Omar Sowwan\OneDrive\���������\Arduino\libraries\Arduino-LiquidCrystal-I2C-library-master/LiquidCrystal_I2C.h:60:7: note:   candidate expects 1 argument, 8 provided

C:\Users\Omar Sowwan\Downloads\FET3S5PJHATN1NF\FET3S5PJHATN1NF.ino: In function 'void setup()':

FET3S5PJHATN1NF:49:17: error: no matching function for call to 'LiquidCrystal_I2C::begin(int, int)'

   lcd.begin(16,2);             //START LCD SCREEN

                 ^

In file included from C:\Users\Omar Sowwan\Downloads\FET3S5PJHATN1NF\FET3S5PJHATN1NF.ino:16:0:

C:\Users\Omar Sowwan\OneDrive\���������\Arduino\libraries\Arduino-LiquidCrystal-I2C-library-master/LiquidCrystal_I2C.h:76:7: note: candidate: void LiquidCrystal_I2C::begin()

  void begin();

       ^~~~~

C:\Users\Omar Sowwan\OneDrive\���������\Arduino\libraries\Arduino-LiquidCrystal-I2C-library-master/LiquidCrystal_I2C.h:76:7: note:   candidate expects 0 arguments, 2 provided

FET3S5PJHATN1NF:50:7: error: 'class LiquidCrystal_I2C' has no member named 'setBacklightPin'; did you mean 'setBacklight'?

   lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE);

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

       setBacklight

FET3S5PJHATN1NF:50:37: error: 'POSITIVE' was not declared in this scope

   lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE);

                                     ^~~~~~~~

exit status 1

no matching function for call to 'LiquidCrystal_I2C::LiquidCrystal_I2C(int, int, int, int, int, int, int, int)'



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

so can you rename المستندات into documents for the time being?

I wonder if some scripts could get confused with multibyte encoding

which version of the IDE are you using?

1.8.19

have you installed all the libraries using the IDE?

no :face_with_monocle: @J-M-L

@J-M-L
?what

read about how to use the IDE and the getting started

https://docs.arduino.cc/software/ide-v1/tutorials/installing-libraries/

I wonder if it's related to this open issue (TL;DR - non ASCII characters in the directory path cause problems):

1 Like

i installed all the libraries @J-M-L
@J-M-L
@J-M-L
And changed the directory
an mini error

Arduino: 1.8.19 (Windows 10), Board: "Arduino Uno"

FET3S5PJHATN1NF:13:10: fatal error: DHT.h: No such file or directory

#include <DHT.h>

      ^~~~~~~

compilation terminated.

exit status 1

DHT.h: No such file or directory

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

@van_der_decken

Hi @its_omar

It is not clear to me what procedure you have followed. I'll provide complete instructions for the procedure you should have followed to work around the bug mentioned by @van_der_decken. You'll have to adapt them according to whatever you have already done:

  1. Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
    The "Preferences" dialog will open.
  2. Click the "BROWSE" button on the right side of the "Sketchbook location" field.
    The "Select a new sketchbook location" dialog will open.
  3. Select a folder in any location that contains only basic ASCII characters (the characters A-z, 0-9, _, -, . are safe).
    :warning: Make sure to pick a location that will be safe to store your files since, in addition to containing installed libraries, the sketchbook is a convenient location to save your sketches.
  4. Click the "Choose" button in the "Select a new sketchbook location" dialog.
  5. Click the "OK" button in the "Preferences" dialog.
  6. Move all the files from the folder at the path of the old sketchbook location:
    C:\Users\Omar Sowwan\OneDrive\المستندات\Arduino\libraries
    
    to the folder at the path of the new sketchbook location you set in the Arduino IDE preferences.

Once you have finished performing the instructions above, try compiling your sketch again. Hopefully the compilation will be successful this time.

@ptillisch @ptillisch got another error

 : Arduino: 1.8.19 (Windows 10), Board: "Arduino Uno" 





















FET3S5PJHATN1NF:33:80: error: no matching function for call to 'LiquidCrystal_I2C::LiquidCrystal_I2C(int, int, int, int, int, int, int, int)'

 LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);

                                                                                ^

In file included from C:\Users\Omar Sowwan\Downloads\FET3S5PJHATN1NF\FET3S5PJHATN1NF.ino:16:0:

C:\Users\Omar Sowwan\OneDrive\Desktop\EVERYTHINGarduino\libraries\Arduino-LiquidCrystal-I2C-library-master/LiquidCrystal_I2C.h:71:2: note: candidate: LiquidCrystal_I2C::LiquidCrystal_I2C(uint8_t, uint8_t, uint8_t, uint8_t)

  LiquidCrystal_I2C(uint8_t lcd_addr, uint8_t lcd_cols, uint8_t lcd_rows, uint8_t charsize = LCD_5x8DOTS);

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

C:\Users\Omar Sowwan\OneDrive\Desktop\EVERYTHINGarduino\libraries\Arduino-LiquidCrystal-I2C-library-master/LiquidCrystal_I2C.h:71:2: note:   candidate expects 4 arguments, 8 provided

C:\Users\Omar Sowwan\OneDrive\Desktop\EVERYTHINGarduino\libraries\Arduino-LiquidCrystal-I2C-library-master/LiquidCrystal_I2C.h:60:7: note: candidate: constexpr LiquidCrystal_I2C::LiquidCrystal_I2C(const LiquidCrystal_I2C&)

 class LiquidCrystal_I2C : public Print {

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

C:\Users\Omar Sowwan\OneDrive\Desktop\EVERYTHINGarduino\libraries\Arduino-LiquidCrystal-I2C-library-master/LiquidCrystal_I2C.h:60:7: note:   candidate expects 1 argument, 8 provided

C:\Users\Omar Sowwan\OneDrive\Desktop\EVERYTHINGarduino\libraries\Arduino-LiquidCrystal-I2C-library-master/LiquidCrystal_I2C.h:60:7: note: candidate: constexpr LiquidCrystal_I2C::LiquidCrystal_I2C(LiquidCrystal_I2C&&)

C:\Users\Omar Sowwan\OneDrive\Desktop\EVERYTHINGarduino\libraries\Arduino-LiquidCrystal-I2C-library-master/LiquidCrystal_I2C.h:60:7: note:   candidate expects 1 argument, 8 provided

C:\Users\Omar Sowwan\Downloads\FET3S5PJHATN1NF\FET3S5PJHATN1NF.ino: In function 'void setup()':

FET3S5PJHATN1NF:49:17: error: no matching function for call to 'LiquidCrystal_I2C::begin(int, int)'

   lcd.begin(16,2);             //START LCD SCREEN

                 ^

In file included from C:\Users\Omar Sowwan\Downloads\FET3S5PJHATN1NF\FET3S5PJHATN1NF.ino:16:0:

C:\Users\Omar Sowwan\OneDrive\Desktop\EVERYTHINGarduino\libraries\Arduino-LiquidCrystal-I2C-library-master/LiquidCrystal_I2C.h:76:7: note: candidate: void LiquidCrystal_I2C::begin()

  void begin();

       ^~~~~

C:\Users\Omar Sowwan\OneDrive\Desktop\EVERYTHINGarduino\libraries\Arduino-LiquidCrystal-I2C-library-master/LiquidCrystal_I2C.h:76:7: note:   candidate expects 0 arguments, 2 provided

FET3S5PJHATN1NF:50:7: error: 'class LiquidCrystal_I2C' has no member named 'setBacklightPin'; did you mean 'setBacklight'?

   lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE);

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

       setBacklight

FET3S5PJHATN1NF:50:37: error: 'POSITIVE' was not declared in this scope

   lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE);

                                     ^~~~~~~~

exit status 1

no matching function for call to 'LiquidCrystal_I2C::LiquidCrystal_I2C(int, int, int, int, int, int, int, int)'



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

@ptillisch @van_der_decken @J-M-L ????

@ptillisch @van_der_decken @J-M-L ????