Error on: 'lcd' was not declared in this scope

I can't seem to figure this out.

/Volumes/Alexei Backup/08 Sketches and Libraries/sketches/1Ultrasonic_people_counter/1Ultrasonic_people_counter.ino:14:32: warning: invalid conversion from 'int' to 't_backlighPol' [-fpermissive]
LiquidCrystal_I2C LCD(0x3F,16,2);
^
In file included from /Volumes/Alexei Backup/08 Sketches and Libraries/sketches/1Ultrasonic_people_counter/1Ultrasonic_people_counter.ino:1:0:
/Users/alexei/Documents/Arduino/libraries/jm_LiquidCrystal_I2C/LiquidCrystal_I2C.h:55:2: note: initializing argument 3 of 'LiquidCrystal_I2C::LiquidCrystal_I2C(uint8_t, uint8_t, t_backlighPol)'
LiquidCrystal_I2C (uint8_t lcd_Addr, uint8_t backlighPin, t_backlighPol pol);
^
/Volumes/Alexei Backup/08 Sketches and Libraries/sketches/1Ultrasonic_people_counter/1Ultrasonic_people_counter.ino: In function 'void setup()':
1Ultrasonic_people_counter:17: error: 'lcd' was not declared in this scope
lcd.begin();
^
/Volumes/Alexei Backup/08 Sketches and Libraries/sketches/1Ultrasonic_people_counter/1Ultrasonic_people_counter.ino: In function 'void loop()':
1Ultrasonic_people_counter:35: error: 'lcd' was not declared in this scope
lcd.setCursor(10, 0);
^
Multiple libraries were found for "LiquidCrystal_I2C.h"
Used: /Users/alexei/Documents/Arduino/libraries/jm_LiquidCrystal_I2C
Not used: /Users/alexei/Documents/Arduino/libraries/Arduino-LiquidCrystal-I2C-library-master
'lcd' was not declared in this scope

_17_Ultrasonic_people_counter.ino (1.24 KB)

(deleted)

no I am new

Welcome to the forum!

If you would take the time to read the stickies, you can see that you should include your code in code tags.

Like this

#include <LiquidCrystal_I2C.h> // Call on the libraries
#include <NewPing.h>
#include <Wire.h>

#define TRIGGER_PIN 7 // Ultrasonic sensor trig to Arduino pin 7
#define ECHO_PIN 8 // Ultrasonic sensor echo to Arduino pin 8
#define MAX_DISTANCE 200

NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE);
int LEDPin = 13; // Set LED to pin 13
int distance; // Variable for distance
int people = 0; // Variable for number of people
boolean count = false; // State for counting
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup() { // Run once to set up the LCD screen and LED
  lcd.begin();
  lcd.backlight();
  pinMode(LEDPin, OUTPUT); // Set the LED as an output
  lcd.print("People:"); // Print People: to the LCD screen
}
void loop() { // This loops forever to check for number of people
  delay(50);
  distance = sonar.ping_cm();// Ping every 50 milliseconds
  // If more than 100cm away, don't count
  if ( distance > 100 && count ) {
    count = false;
    digitalWrite(LEDPin, LOW);
  }
  // If less than 100cm away, count 1
  if ( distance < 100 && distance != 0 && !count) {
    count = true;
    people ++; // Keep adding 1 per count
    digitalWrite(LEDPin, HIGH);
    lcd.setCursor(10, 0);
    lcd.print(people); // Print number of people to LCD screen
  }
}

it's the </> symbol in the top left. STRG+T before if necessary.

Regarding your code you defined LCD but use lcd later on. These declarations should be case sensitive and therefore you should either declare lcd in the beginning or use LCD in your code, up to you.

Also you should take care of this error

     ^
Multiple libraries were found for "LiquidCrystal_I2C.h"
 Used: /Users/alexei/Documents/Arduino/libraries/jm_LiquidCrystal_I2C
 Not used: /Users/alexei/Documents/Arduino/libraries/Arduino-LiquidCrystal-I2C-library-master

Ya, I got the error too. but I'm going by a textbook and there was a lot of things that are wrong. google is not much help.

Ya that also got me too. Still cant figure out why

you defined LCD but use lcd later on.

Where is LCD defined in the code ?

@UKHelibob good catch, I was looking at

/Volumes/Alexei Backup/08 Sketches and Libraries/sketches/1Ultrasonic_people_counter/1Ultrasonic_people_counter.ino:14:32: warning: invalid conversion from 'int' to 't_backlighPol' [-fpermissive]
[b] LiquidCrystal_I2C LCD(0x3F,16,2);[/b]

chuckyx:
@UKHelibob good catch, I was looking at

/Volumes/Alexei Backup/08 Sketches and Libraries/sketches/1Ultrasonic_people_counter/1Ultrasonic_people_counter.ino:14:32: warning: invalid conversion from 'int' to 't_backlighPol' [-fpermissive]

LiquidCrystal_I2C LCD(0x3F,16,2);

It looks like the OP may have posted the error message from a different version of the program

Multiple libraries were found for "LiquidCrystal_I2C.h"
Used: /Users/alexei/Documents/Arduino/libraries/jm_LiquidCrystal_I2C
Not used: /Users/alexei/Documents/Arduino/libraries/Arduino-LiquidCrystal-I2C-library-master
/Volumes/Alexei Backup/08 Sketches and Libraries/sketches/1Ultrasonic_people_counter/1Ultrasonic_people_counter.ino:14:32: warning: invalid conversion from 'int' to 't_backlighPol' [-fpermissive]
LiquidCrystal_I2C LCD(0x3F,16,2);
^
In file included from /Volumes/Alexei Backup/08 Sketches and Libraries/sketches/1Ultrasonic_people_counter/1Ultrasonic_people_counter.ino:1:0:
/Users/alexei/Documents/Arduino/libraries/jm_LiquidCrystal_I2C/LiquidCrystal_I2C.h:55:2: note: initializing argument 3 of 'LiquidCrystal_I2C::LiquidCrystal_I2C(uint8_t, uint8_t, t_backlighPol)'
LiquidCrystal_I2C (uint8_t lcd_Addr, uint8_t backlighPin, t_backlighPol pol);
^
/Volumes/Alexei Backup/08 Sketches and Libraries/sketches/1Ultrasonic_people_counter/1Ultrasonic_people_counter.ino: In function 'void setup()':
1Ultrasonic_people_counter:17: error: no matching function for call to 'LiquidCrystal_I2C::begin()'
LCD.begin();
^
/Volumes/Alexei Backup/08 Sketches and Libraries/sketches/1Ultrasonic_people_counter/1Ultrasonic_people_counter.ino:17:13: note: candidate is:
In file included from /Volumes/Alexei Backup/08 Sketches and Libraries/sketches/1Ultrasonic_people_counter/1Ultrasonic_people_counter.ino:1:0:
/Users/alexei/Documents/Arduino/libraries/jm_LiquidCrystal_I2C/LiquidCrystal_I2C.h:112:15: note: virtual void LiquidCrystal_I2C::begin(uint8_t, uint8_t, uint8_t)
virtual void begin(uint8_t cols, uint8_t rows, uint8_t charsize = LCD_5x8DOTS);
^
/Users/alexei/Documents/Arduino/libraries/jm_LiquidCrystal_I2C/LiquidCrystal_I2C.h:112:15: note: candidate expects 3 arguments, 0 provided
exit status 1
no matching function for call to 'LiquidCrystal_I2C::begin()'

Now this happens

After I have resulted from this problem I get a second error please help google does not give it to me clearly.

Here is the code:

#include <LiquidCrystal_I2C.h> // Call on the libraries
#include <NewPing.h>
#include <Wire.h>

#define TRIGGER_PIN 7 // Ultrasonic sensor trig to Arduino pin 7
#define ECHO_PIN 8 // Ultrasonic sensor echo to Arduino pin 8
#define MAX_DISTANCE 200
NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE);

int LEDPin = 13; // Set LED to pin 13
int distance; // Variable for distance
int people = 0; // Variable for number of people
boolean count = false; // State for counting
LiquidCrystal_I2C LCD(0x3F,16,2);

void setup() { // Run once to set up the LCD screen and LED
  LCD.begin();
  LCD.backlight();
  pinMode(LEDPin, OUTPUT); // Set the LED as an output
  LCD.print("People:"); // Print People: to the LCD screen
}
void loop() { // This loops forever to check for number of people
  delay(50);
  distance = sonar.ping_cm();// Ping every 50 milliseconds
  // If more than 100cm away, don't count
  if ( distance > 100 && count ) {
    count = false;
    digitalWrite(LEDPin, LOW);
  }
  // If less than 100cm away, count 1
  if ( distance < 100 && distance != 0 && !count) {
    count = true;
    people ++; // Keep adding 1 per count
    digitalWrite(LEDPin, HIGH);
    LCD.setCursor(10, 0);
    LCD.print(people); // Print number of people to LCD screen
  }
}

And here is the error:

Multiple libraries were found for "LiquidCrystal_I2C.h"
Used: /Users/alexei/Documents/Arduino/libraries/jm_LiquidCrystal_I2C
Not used: /Users/alexei/Documents/Arduino/libraries/Arduino-LiquidCrystal-I2C-library-master
/Volumes/Alexei Backup/08 Sketches and Libraries/sketches/1Ultrasonic_people_counter/1Ultrasonic_people_counter.ino:14:32: warning: invalid conversion from 'int' to 't_backlighPol' [-fpermissive]
LiquidCrystal_I2C LCD(0x3F,16,2);
^
In file included from /Volumes/Alexei Backup/08 Sketches and Libraries/sketches/1Ultrasonic_people_counter/1Ultrasonic_people_counter.ino:1:0:
/Users/alexei/Documents/Arduino/libraries/jm_LiquidCrystal_I2C/LiquidCrystal_I2C.h:55:2: note: initializing argument 3 of 'LiquidCrystal_I2C::LiquidCrystal_I2C(uint8_t, uint8_t, t_backlighPol)'
LiquidCrystal_I2C (uint8_t lcd_Addr, uint8_t backlighPin, t_backlighPol pol);
^
/Volumes/Alexei Backup/08 Sketches and Libraries/sketches/1Ultrasonic_people_counter/1Ultrasonic_people_counter.ino: In function 'void setup()':
1Ultrasonic_people_counter:17: error: no matching function for call to 'LiquidCrystal_I2C::begin()'
LCD.begin();
^
/Volumes/Alexei Backup/08 Sketches and Libraries/sketches/1Ultrasonic_people_counter/1Ultrasonic_people_counter.ino:17:13: note: candidate is:
In file included from /Volumes/Alexei Backup/08 Sketches and Libraries/sketches/1Ultrasonic_people_counter/1Ultrasonic_people_counter.ino:1:0:
/Users/alexei/Documents/Arduino/libraries/jm_LiquidCrystal_I2C/LiquidCrystal_I2C.h:112:15: note: virtual void LiquidCrystal_I2C::begin(uint8_t, uint8_t, uint8_t)
virtual void begin(uint8_t cols, uint8_t rows, uint8_t charsize = LCD_5x8DOTS);
^
/Users/alexei/Documents/Arduino/libraries/jm_LiquidCrystal_I2C/LiquidCrystal_I2C.h:112:15: note: candidate expects 3 arguments, 0 provided
exit status 1
no matching function for call to 'LiquidCrystal_I2C::begin()'

My post wasn't accessible anymore since the other topic was locked. Here's it again in condensed form:

You are using 2 libraries with the same name (did you rename one of them manually?). Which libraries documentation are you looking at? Post the link. Get rid of the other one. The one used by the IDE most likely doesn't take begin() empty or at all, don't know. Hard to tell without looking at it.

could you please name the 2 libraries that are the same

Read your error messages, it's not that hard to find.

It was buried right at the top of your error message as the very first line. No wonder you couldn't find it.

Here it is

Multiple libraries were found for "LiquidCrystal_I2C.h"