Trying to find LCD.h

im trying to upload a sketch to an auduino mini but it keeps saying

sketch_oct07a:16:10: fatal error: LCD.h: No such file or directory
 #include <LCD.h>
          ^~~~~~~
compilation terminated.
exit status 1
LCD.h: No such file or directory

where do i find that
here is where i got the code from
Arduino PWM Fan Control with LCD and UI
ive tried downloading LCD.h and adding it via sketch/add file
but nothing works ,
any help would be much apreciated .
thanks
martin

There are lots of LCD libraries, and you will need to either find the exact library that the author of that code used, or revise the code to match whichever LCD library you decide to use.

It is not clear to me what LCD.h is supposed to do, since it doesn't seem to be referenced in the code. Try leaving out the #include <LCD.h>

1 Like

Some versions of LiquidCrystal_I2C (of which there are multiples) include LCD.h, some do not.

One solution is to replace the LiquidCrystal_I2C library with the hd44780 library.

Here is how to swith frome LiquidCrystal_I2C library (any of them) to the hd44780 library. >> ioClass: hd44780_I2Cexp · duinoWitchery/hd44780 Wiki · GitHub

1 Like

i found one ,but now its says

sketch_oct07a:68:53: error: 'POSITIVE' was not declared in this scope
 LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
                                                     ^~~~~~~~
exit status 1
'POSITIVE' was not declared in this scope

im a bit lost
thanks

Again, there are several LiquidCrystal_I2C libraries. They are not all compatible and they each can have there own, proprietary, fuctions and parameters. Keep guessing or change to the best library available, the hd44780 library.

1 Like

Why ? The code is not very good.

A 'bool' variable is true or false. This is weird:

boolean FanStop = HIGH;
...
if (FanStop) {

Buttons are read in multiple places.
Some code is repeated, for example the debounce for the buttons.
When variables are incremented or decremented with a button, then there is no limit for the minimal and maximum value.
Integers are stored as bytes in the EEPROM, possibly losing a byte.

1 Like

The code compiles with this library https://github.com/fmalpartida/New-LiquidCrystal

Be careful to remove any other libraries that have the LCD.h file, or the compiler may not choose the correct one.

In addition to the problems with the sketch mentioned by @Koepel, there are several return statements returning values from functions that are declared void.

1 Like

thanks for the help

Actually this is the correct direct link in the wiki to convert from fm's LIquidCrystal_I2C to hd44780 hd44780_I2Cexp
(The one you posted is for converting the Frank de Brabander LiquidCrystal_I2c to hd44780 hd44780_I2Cexp

https://github.com/duinoWitchery/hd44780/wiki/ioClass:-hd44780_I2Cexp#to-switch-from-f-malpartidas-aka-fm-newliquidcrystal-liquidcrystal_i2c-to-hd44780_i2cexp


@montyfert,
Like others have stated there are several LCD libraries out there, with varying level of support that all use a LiquidCrystal_I2C.h header file which can make things a bit confusing.

If you switch to the hd44780 library, there are no issues due to collisions with other LCD libraries or their header files and it is easier to install than fm's newLiquidCrystal library as the hd44780 library can be downloaded and installed directly from the IDE GUI using the library manager.

There are a few small changes needed in the sketch, but those are limited to the header files and the lcd object declaration and are noted in the wiki pages.

if you do decide to switch to the hd44780 library I would highly recommend that you spend a few minutes reading some of the documentation.
I would recommend at least reading the main wiki, and the hd44780_I2Cexp wiki
pages. This will explain the library structure and how/where to find the example sketches for each i/o class.

direct link to hd44780 wiki:
https://github.com/duinoWitchery/hd44780/wiki

direct link to hd44780 library hd44780_I2Cexp i/o class wiki:
https://github.com/duinoWitchery/hd44780/wiki/ioClass:-hd44780_I2Cexp

direct link to hd44780 library info:
https://github.com/duinoWitchery/hd44780#readme
--- bill

2 Likes

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.