Can someone help me understand what my problem is with libraries?
I have used them and downloaded them before but it seems random whether or not they will work.
Sometimes I download them, and the computer says the zip file has the wrong kind of characters in the name, and so I wonder why a person would provide a file, and name it something arduino can't open, because it has dashes, etc in it?
I am so frustrated. I have downloaded half a dozen RFID files and EVERY SINGLE ONE OF THEM HAS ERRORS about type not named, etc.
I have put the library files in with the examples, in the library folder, tried importing them, and there again, the arduino wants only zip files for that importing process. WHY?
Many times on these forums, I find the information overloaded with extraneous information that confuses the core issue, or information is left out that directly deals with the problem. Can someone help me? I just want to try a simple rc522 rfid card reader. Why is this so difficult to do?
After you download, you have to unzip the folder.
Sometimes there is a single folder in the folder, but just sometimes. If so, then you may need to remove the outer folder.
Then open the Arduino IDE and use Sketch, Import Library, Add Library then select the unzipped folder and open.
The IDE will then install the library.
Sometimes compressors (zip, rar, etc.) does not preserve paths, people are using different OSes once they pack their files it is incompatible with other OS sometimes. But if you know how Arduino IDE parses libraries from ZIP files or extracted files, you can easily fix those issues. For RC522 RFID Module I suggest you to use MFRC522 library which can be found here : GitHub - miguelbalboa/rfid: Arduino RFID Library for MFRC522 download ZIP file and extract it to Sketch folder under "libraries".
For windows XP you should have this files under correct path
\Documents and Settings$USER$\My Documents\Arduino\libraries\mfrc522
And here is my RFID Door Unlock Project which uses same RC522 module if you want to take a look
Installing libraries ready to be used in programs is simple.
Each library goes in a folder in the libraries folder of the sketch directory. Each library will usually consist of a .h file and a .cpp file each with the same name. The library folder must have the same name as the .h and .cpp files. Note that 'same name' means that they must be exactly the same.
Once installed close and restart the IDE to make the library available for inclusion in a program.
I wonder why a person would provide a file, and name it something arduino can't open, because it has dashes, etc in it?
That is often done to support version control, and is often done by the version control software, not by the developer.
It doesn't take but five seconds to rename a directory that the Arduino IDE doesn't like. Compare that to the time it would take you to create the library, and see of you have a reasonable complaint.
I wonder why a person would provide a file, and name it something arduino can't open, because it has dashes, etc in it?
That is often done to support version control, and is often done by the version control software, not by the developer.
It doesn't take but five seconds to rename a directory that the Arduino IDE doesn't like. Compare that to the time it would take you to create the library, and see of you have a reasonable complaint.
omersiar:
Sometimes compressors (zip, rar, etc.) does not preserve paths, people are using different OSes once they pack their files it is incompatible with other OS sometimes. But if you know how Arduino IDE parses libraries from ZIP files or extracted files, you can easily fix those issues. For RC522 RFID Module I suggest you to use MFRC522 library which can be found here : GitHub - miguelbalboa/rfid: Arduino RFID Library for MFRC522 download ZIP file and extract it to Sketch folder under "libraries".
For windows XP you should have this files under correct path
\Documents and Settings$USER$\My Documents\Arduino\libraries\mfrc522
And here is my RFID Door Unlock Project which uses same RC522 module if you want to take a look
Thank you very much, Omersiar. Even when I installed the libraries of the other codes, they had errors I could not fix. Your code and libraries worked with no errors at all. I should be able to adapt your code to use with my project. Thank you again.
spycatcher2k:
Have you tried searching for how to install libraries and followed the logic behind some of the names downloads have to use (Git hub and others use extended naming conventions) - It's not hard to look inside the folder, find the name of the library and rename a folder, as far as not working, this is usually down to the IDE version you are using (newer is not always better), I use multiple versions from 18 up to 1.5.2, Libraries that work in one may not work in others. I've also had to 'tweek' some libraries to work correctly.
Hope this gives some help.
Thank you spycatcher. I have read about the libraries before but I still find it difficult to understand why some libraries are in folders with their ino files and some are not, but thanks to everyone's advice, I seem to be getting the hang of getting libraries to import.
steinie44:
After you download, you have to unzip the folder.
Sometimes there is a single folder in the folder, but just sometimes. If so, then you may need to remove the outer folder.
Then open the Arduino IDE and use Sketch, Import Library, Add Library then select the unzipped folder and open.
The IDE will then install the library.
Thank you, Steinie44. That seems to be working just fine. I appreciate your advice.
UKHeliBob:
Installing libraries ready to be used in programs is simple.
Each library goes in a folder in the libraries folder of the sketch directory. Each library will usually consist of a .h file and a .cpp file each with the same name. The library folder must have the same name as the .h and .cpp files. Note that 'same name' means that they must be exactly the same.
Once installed close and restart the IDE to make the library available for inclusion in a program.
Thank you, UKHeliBob. I am starting to get the hang of this, thanks to everyone's advice. You are all very kind to help me with this.
I wonder why a person would provide a file, and name it something arduino can't open, because it has dashes, etc in it?
That is often done to support version control, and is often done by the version control software, not by the developer.
It doesn't take but five seconds to rename a directory that the Arduino IDE doesn't like. Compare that to the time it would take you to create the library, and see of you have a reasonable complaint.
Thank you, PaulS. I am not complaining. I was only wondering why the files would be delivered in a way that would cause them to fail to work. I am starting to get the idea, on how to install the libraries, and some of my frustration was in not knowing which errors were because of the libraries not being installed, and which ones were ino code that was in error. Thank you for your timely reply.