LiquidCrystal error 'LiquidCrystal' does not name a type.

::slight_smile: I am stuck!

Could use your help please.

I have other Liquid Crystal programs that work, so why does this one not work?

#include <LiquidCrystal.h>

LiquidCrystal lcd( 4, 5, 6, 7, 8, 9); <= error

void setup(){
lcd.begin(16, 2); // columns of 16 characters and two rows
lcd.clear(); // Clear screen
}

void loop()
{
int zz = 170; // ZZ is the variable, where 170 is stored
lcd.setCursor( 0, 0);
lcd.print(" Binary: “);
lcd.print( zz, BIN); // display 170 in binary
lcd.setCursor( 0, 1); // Binary: 10101010
lcd.print(” Hexadecimal: "); // display 170 in hexadecimal
lcd.print( zz, HX); // Hex: AA
delay(1000);
}

Also have errors like> lcd, HX, not declared in this scope

Thanks
Frank G./

I believe that means a missing or improperly installed library. "Properly Installed" includes restarting the IDE so that it can find the new library.

Hi!

I read that on GooGle.

I copied this code from Ardunio Workbook.

I also typed it in and I still got this error.

You can copy code all night, but it won't work if you have not installed the libraay

I am also suss about the wiring order. It is not normal but is OK if it complies with the display wiring.

I read that on GooGle.

Does that mean you fixed it, too?

I copied this code from Ardunio Workbook.

The fact you misspelled Arduino suggests you may have typed in it wrong.

Go to the directory where you installed the IDE and look for the libraries directory and see if the LiquidCrytal library is there. If it is, go back to the original source code and see if they expect a non-standard version of that library to be installed. If so, install the new version of the library, close the IDE down and reopen it.

Having done that, please read the two posts at the top of the Forum for the proper way to make a post here, including how to post code so it's easier for us to read.

The sure way to identify if you have correct library referenced is to use IDE menu

Sketch->Import library instead of typing it in.

You will know right away if it is not in correct / expected directory ( not in menu - see previous post) and if it is you will eliminate typos.

your error

lcd.print( zz, HEX);             // change HX to HEX

also if you want to display the data on your lcd for 4 seconds for example

then clear the lcd display and do it all over again in the loop try this

void loop() 
{ 
 int zz = 170;                   // ZZ is the variable, where 170 is stored
lcd.setCursor( 0, 0); 
lcd.print(" Binary: "); 
lcd.print( zz, BIN);             // display 170 in binary 
lcd.setCursor( 0, 1);            // Binary: 10101010
lcd.print(" Hexadecimal: ");     // display 170 in hexadecimal
lcd.print( zz, HEX);              // Hex: AA      NOT HX !     
delay(4000);   // show the above data for four seconds
 lcd.clear();

}

Also read thru this link for your first problem

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

Do not forget to follow this guy's advice:

Sketch->Import library instead of typing it in.

double check the wiring and everything

your lcd display will work