LCD library error

Hey guys,
Just got an LCD for my Arduino and am having an issue with the code. It says I am missing a file that is clearly there. Maybe I’m using an older code? Is there a direct link to the LCD Library? There is no link on this page as you would expect.
http://www.arduino.cc/en/Reference/LiquidCrystal. The library I downloaded was offsite.

I’ve attached a a pic.

Thanks in advance!

The #include directive has two forms
“filename.h” includes a file in the same directory as your sketch.
<filename.h> includes a file from the libraries sub folder within your sketch folder.

Option 1.
The demo sketch will probably compile if you change

//#include <LiquidCrystal.h>
#include "LiquidCrystal.h"

Option 2.
Install the .h and .cpp files as a library
Find your sketch folder
Create a sub folder named ‘ibraries’
Create a sub folder in Libraries name ‘LiquidCrystal’
Copy LiquidCrystal.h and LiquidCrystal.cpp into your new libraries\LiquidCrystal folder.

#include <LiquidCrystal.h>
Should then find the files.

Is there a direct link to the LCD Library?

It is included as part of the IDE package. There is no need to download anything. Doing so is a mistake.

MattS-UK:
The #include directive has two forms
“filename.h” includes a file in the same directory as your sketch.
<filename.h> includes a file from the libraries sub folder within your sketch folder.

Option 1.
The demo sketch will probably compile if you change

//#include <LiquidCrystal.h>

#include “LiquidCrystal.h”

Ok, I tried this and now I get a new error.

Standard Error Msg.
Arduino: 1.5.7 (Windows 7), Board: “Arduino Uno”

In file included from HelloWorld.pde:39:0:
LiquidCrystal.h:7:17: fatal error: SPI.h: No such file or directory
#include <SPI.h>
^
compilation terminated.

Verbose
Arduino: 1.5.7 (Windows 7), Board: “Arduino Uno”

lC:\Program Files (x86)\Arduino/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=157 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard C:\Users\Rob\AppData\Local\Temp\build3632887940634616561.tmp\HelloWorld.cpp -o C:\Users\Rob\AppData\Local\Temp\build3632887940634616561.tmp\HelloWorld.cpp.o

In file included from HelloWorld.pde:39:0:
C:\Users\Rob\AppData\Local\Temp\build3632887940634616561.tmp\LiquidCrystal.h:7:17: fatal error: SPI.h: No such file or directory
#include <SPI.h>
^
compilation terminated.

Should I just delete these files and start over?
Thanks for the help!

PaulS:

Is there a direct link to the LCD Library?

It is included as part of the IDE package. There is no need to download anything. Doing so is a mistake.

The files I’m using were not in my “examples”. I had to download it. When I copied and pasted the code below into IDE, it was asking for “LiquidCrystal.ccp” and “LiquidCrystal.h”. After downloading and extracting LiquidCrystal.zip ( I can’t remember where atm), I got all the examples and files it was asking for but still had a prob with “LiquidCrystal.h”. Now as you see in the previous response, I get a different error that I haven’t had yet. I attached a pic of the examples I gained in the zip.

This code is from here http://arduino.cc/en/Tutorial/LiquidCrystal

/*
  LiquidCrystal Library - Hello World
 
 Demonstrates the use a 16x2 LCD display.  The LiquidCrystal
 library works with all LCD displays that are compatible with the
 Hitachi HD44780 driver. There are many of them out there, and you
 can usually tell them by the 16-pin interface.
 
 This sketch prints "Hello World!" to the LCD
 and shows the time.
 
  The circuit:
 * LCD RS pin to digital pin 12
 * LCD Enable pin to digital pin 11
 * LCD D4 pin to digital pin 5
 * LCD D5 pin to digital pin 4
 * LCD D6 pin to digital pin 3
 * LCD D7 pin to digital pin 2
 * LCD R/W pin to ground
 * 10K resistor:
 * ends to +5V and ground
 * wiper to LCD VO pin (pin 3)
 
 Library originally added 18 Apr 2008
 by David A. Mellis
 library modified 5 Jul 2009
 by Limor Fried (http://www.ladyada.net)
 example added 9 Jul 2009
 by Tom Igoe
 modified 22 Nov 2010
 by Tom Igoe
 
 This example code is in the public domain.

 http://www.arduino.cc/en/Tutorial/LiquidCrystal
 */

// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.print("hello, world!");
}

void loop() {
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(0, 1);
  // print the number of seconds since reset:
  lcd.print(millis()/1000);
}

Should I just delete these files and start over?

Yes.

The version of LiquidCrystal that ships with the IDE does not include SPI.h.

Got it! I uninstalled 1.5.7 Beta and installed 1.06. The program seems slower to load projects but it is working.
Thanks!

hi, im working with the arduino mega 2560 when i try to compile any of the lcd codes this error pops up:

/tmp/650139257/Display/Display.ino:41:27: fatal error: LiquidCrystal.h: No such file or directory

compilation terminated.

exit status 1

im using the web editor how do i resole this.

thanks

@iyerrahul

I suggest that you click the ‘report to moderator’ link under your post and ask for your post to be moved to the webeditor section.

I suspect that this is specific to the web editor. Can’t help you further.

You can use

#include <LiquidCrystal.h>

then you will be able to use the LCD sensor.