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>
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
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.
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.
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.
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
@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.