I added the liquid crystal library to my arduino folder however when I try to run the following code it reads an error:
#include <LiquidCrystal.h>
LiquidCrystal lcd(12,11,5,4,3,2);
const int inPin = 0;
void setup()
{
lcd.begin(16,2);
}
void loop()
{
int value: = analogRead(inPin);
lcd.setCursor(0,1);
float millivolts = (value / 1024.0) * 5000;
float celsius = millivolts / 10;
lcd.clear();
lcd.setCursor(0,0);
lcd.print(celsius);
lcd.print("C");
lcd.setCursor(0,1);
lcd.print((celsius*9)/5 + 32);
lcd.print("F");
lcd.print("I Love Zelma");
delay(1000);
}
Error;
In file included from sketch_jun03a.ino:1:0:
/Users/KingTuthill/Documents/Arduino/libraries/libraries/LiquidCrystal/LiquidCrystal.h:6:17: fatal error: SPI.h: No such file or directory
#include <SPI.h>
^
compilation terminated.
Multiple libraries were found for "LiquidCrystal.h"
Used: /Users/KingTuthill/Documents/Arduino/libraries/libraries/LiquidCrystal
Not used: /Applications/Arduino.app/Contents/Java/libraries/LiquidCrystal
Error compiling.
/Users/KingTuthill/Documents/Arduino/libraries/libraries/LiquidCrystal/LiquidCrystal.h:6:17:
Is probably where your problem lies. Just keep all your libraries in the same folder.
This is the only library I have added so far. Where should I keep the library? is it okay to just keep the library on a folder that I have put in my documents folder as I have done here?
Probably not. As I said, put your new libraries with all the other libraries, i.e. where Arduino can find it. By that, I mean the libraries that came with Arduino.
I can only guess where that is but it's probably under \Arduino, and won't be hard to find. This is a probvlem you will only have once.
I was able to delete the second library and now I get this error:
In file included from sketch_jun06a.ino:1:0:
/Users/KingTuthill/Documents/Arduino/libraries/libraries/LiquidCrystal/LiquidCrystal.h:6:17: fatal error: SPI.h: No such file or directory
#include <SPI.h>
^
compilation terminated.
Error compiling.
I don't think there is a way to rectify the DOS path you have, but you don't actually have to do that. Arduino is looking at a dumb address and, perhaps unsurprisingly, it isn't finding what it is looking for.
I don't know how the IDE can get itself into the position where it looks at such an address. I don't think there a preferences command to do that.
But it is looking along the path it tells you. If you put the library folder there, it should find it.
You might do a search for other files *.h. They should all be in the same place.
Frankly, you might be better off backing up all your Arduino programmes, uninstalling Arduino, and starting over with a new installation in a more sensible arrangement. Arduino is not a document, it is a programme, but I won't ask what it is doing in the \Documents folder. Assuming you actually own the computer, one would imagine it all goes simply in the \Programme Files folder or something like it, along with all the other programmes, like Microsoft Office.
I follwed your instructions and reinstalled the program. I had to move around the library so that all of the libraries were located in the same place but everything is working great now. Thank you so much for your help!