Not sure if i've posted in the correct area - apologies if not
Im a total newbie to this. Ive tried to paste someone elses code into IDE tonight and getting this error. Obviously I've done something wrong?
Can anyone advise?
Thanks
C:\Users\ameth\AppData\Local\Temp.arduinoIDE-unsaved2024011-3372-nh435j.eaqd\sketch_jan11a\sketch_jan11a.ino:2:10: fatal error: LiquidCrystal_I2C.h: No such file or directory #include <LiquidCrystal_I2C.h>
^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1
Compilation error: LiquidCrystal_I2C.h: No such file or directory
Although you have not posted your sketch properly (that was hint to use code tags), the error message seems clear. The compiler cannot find the LiquidCrystal_I2C library
Is it installed on your PC and, of so, where is it located ?
I have now added the file needed. I now get the below error:
C:\Users\ameth\AppData\Local\Temp.arduinoIDE-unsaved2024012-3372-1gqx5y2.dimm\sketch_jan12a\sketch_jan12a.ino:10:53: error: 'POSITIVE' was not declared in this scope
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
^~~~~~~~
C:\Users\ameth\AppData\Local\Temp.arduinoIDE-unsaved2024012-3372-1gqx5y2.dimm\sketch_jan12a\sketch_jan12a.ino:94:1: error: expected unqualified-id before ']' token
]
^
exit status 1
Compilation error: 'POSITIVE' was not declared in this scope
There are two common libraries with a header file named LiquidCrystal_I2C.h. These libraries have different APIs so if you try to compile a sketch that was written for one library while the other library is installed, compilation will fail with an error like the one you reported here.
I think the best solution will be for you to install the library your sketch was written to be used with. I'll provide instructions:
A. Uninstall Incorrect Library
Select Sketch > Include Library > Manage Libraries... from the Arduino IDE menus to open the "Library Manager" view in the left side panel.
Type LiquidCrystal I2C in the "Filter your search..." field.
Scroll down through the list of libraries until you see the "LiquidCrystal I2C by Frank de Brabander" entry.
You will see an "REMOVE" button at the bottom of the entry. Click the button.
The "Uninstall" dialog will open.
Click the "YES" button in the "Uninstall" dialog.
Wait for the uninstall process to finish, as indicated by a notification at the bottom right corner of the Arduino IDE window:
Unfortunately the correct library is not available for installation via the Arduino Library Manager so a different installation procedure is required than usual:
Select Download ZIP from the menu.
A download of the ZIP file of the library will start.
Wait for the download to finish.
Select Sketch > Include library > Add .ZIP Library from the Arduino IDE menus.
The "Select the zip file containing the library you'd like to add" dialog will open.
Select the downloaded file from the dialog.
Click the "Open" button.
Wait for the installation process to finish, as indicated by a notification at the bottom right corner of the Arduino IDE window:
ⓘ Successfully installed library from New-LiquidCrystal-master.zip archive
Now try compiling your sketch again. Hopefully this time it will compile without any errors.
I'll provide instructions you can follow to do that:
Do an Auto Format on your code by pressing Ctrl+B. ⓘ This is done to make the code easier for us to read.
Click on the window that contains your sketch code.
Press the Ctrl+A keyboard shortcut.
This will select all the text.
Press the Ctrl+C keyboard shortcut.
This will copy the selected text to the clipboard.
In a forum reply here, click on the reply field.
Click the <CODE/> icon on the post composer toolbar.
This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
Press the Ctrl+V keyboard shortcut.
This will paste the compilation output into the code block.
Move the cursor outside of the code block markup before you add any additional text to your reply.
Repeat the above process if your sketch has multiple tabs.
I've uploaded the sketch to the arduino uno successfully but the lcd isn't showing anything. It lights up and the red led is lit on the back but the screen is totally blank. Is this the right section or do i need to post to another? thanks