Libraries revisited

HI in a recent post I ask for some help with the library files. The problem for me was were are the zip files.
Some one told me where I could get the zip files I needed. While helpful this did not answer my problem. there are all kind of files listed in the library. But how do I use these files? Everything I read for installing libraries said to copy the zip file. But where is the zip file in the library?

Why start a new thread when you already have one on this very subject? That's considered cross-posting, and is against the forum rules.

What you should have done was reply in that thread, and explain what you wanted a bit more clearly so we could understand.

So that anyone reading has the full background, the original thread is here:- Using Libraries
And here's the question originally asked in that thread:-

In the instruction to import a library. First you copy the zip file to your hard drive. My problem is where is the zip file. Example: I need two files from the Arduino library. http://www.arduino.cc/en/Reference/Libraries
The program names are Matrix and Sprite. I found the titles but where is the zip files?

But where is the zip file in the library?

There is no zip file in the library. The library is downloaded from the host site as a zip file, then extracted and installed.
To install, you place the extracted library folder in your Sketchbook\libraries folder, then restart the IDE to use it.

Because you didn't describe your problem well in your original thread, when you said this I thought you wanted to know where to get the zip file(s):-

First you copy the zip file to your hard drive. My problem is where is the zip file.

Edit: Also, as mentioned in the first thread, the "Matrix" and "Sprite" (Wiring) libraries, (compressed in the zip file), are still available here:-Matrix & Sprite Libraries
The download link is near the top and toward the bottom of the page are links to the documentation on the 'Wiring' site.

First please let me apologize I had no intention of cross posting. I was afraid that if I used that post that I would be excuse of reviving an old post. Due to the first response I was afraid that I did not make myself clear enough as to what I wanted.

I did get both files successfully load in my library. Thank you.

To move on, I still don't understand this quote.

There is no zip file in the library. The library is downloaded from the host site as a zip file, then extracted and installed.
To install, you place the extracted library folder in your Sketchbook\libraries folder, then restart the IDE to use it.

How do you download the library file as a zip? I see no option for coping or converting the listed name to a zip. How would I get the file Matrix from this library or any other file?

There is so much to learn here, sometimes I am just over whelm by it all.

Most of the files I ask for are form other sketches that I try, or sketches from books that I buy.

Downloading a library file is up to your browser. Normally you click on the link and the file is saved into your download directory. This file is normally in the zip format. You then uncompressed it by double clicking it.

Naneen:
To move on, I still don’t understand this quote:-

There is no zip file in the library. The library is downloaded from the host site as a zip file, then extracted and installed.
To install, you place the extracted library folder in your Sketchbook\libraries folder, then restart the IDE to use it.

How do you download the library file as a zip? I see no option for coping or converting the listed name to a zip. How would I get the file Matrix from this library or any other file?

On the page that I linked, (this one), which hosts the ‘Matrix’ and ‘Sprite’ libraries, you’ll see the download link in the image below:-
(If the image is too small to see properly, right-click on it and select “View Image” or similar depending on your browser.)
Matrix & Sprite Download.JPG

You right-click on that link, “Matrix_Sprite.zip” then save the zip file to your desktop or somewhere else that’s convenient by selecting “Save link as…” or similar from the popup menu.

Then, once the zip file has downloaded, unzip it and in this case you’ll have two folders, “Matrix” and “Sprite”.
In my case, to ‘unzip’ the file, I right-click on it, then choose “Extract all…” from the popup menu.

All you have to do then is copy (or move) those folders into your Arduino Sketchbook\libraries folder, then re-start the Arduino IDE if it was previously open.

Now those libraries will be accessible from within the IDE, and any examples included with them can be found under >File >Examples, then the name of the library, (either “Matrix” or “Sprite”).

I was successful downloading Matrix and Sprite from your first post.

My problem is in the library download. When I go to [
under Display and LEDs, if I click on Matrix there is no way for me to make a zip file. if I click on it I go to a site call Wiring, If I click on download I get a program wiring. If I click on Matrix a sketch is shown that makes no sense or even looks like a zip file.
Back to Display and LEDs. I click on LedControl (for Matrix MAX7219) I end up here. [
If I click on the other LedContrl I end up here.[
So back to my original question, How do I make a zip file form these files?

By the way, every time I use the insert a link it does it twice like below.
http://www.wayoda.org/arduino/ledcontrol/index.html

Please disregard I have no idea what happen in this post.
](LedControl)](http://playground.arduino.cc/Main/LedControl)](http://www.arduino.cc/en/Reference/Libraries)

You need to edit and correct your last post. It's just a great big link at the moment.
You added this edit as I was typing:-

Please disregard I have no idea what happen in this post.

Rather than edit and say that, why not edit and fix the problem?

"Matrix" and "Sprite" are very old libraries, and as it says on the Arduino libraries page:-

The Matrix and Sprite libraries are no longer part of the core distribution.

Arduino evolved from 'Wiring', which is why the documentation for those libraries is on that site.
But there's nowhere on that site, or the Arduino site, where those libraries can be found for download, so I did a search and found the source that I linked to. Consider that site the official host of those libraries now, and stop looking for them elsewhere. If you have copies of them, and they're working, what more do you want?
You say in your last post:-

My problem is in the library download.

What problem - you have the libraries don't you? And there's the documentation/example(s) both on the 'www.pjrc.com' website and the 'Wiring' website.

If I click on Matrix a sketch is shown that makes no sense or even looks like a zip file.

Correct, that sketch is an example for you to study - not a library.

I really don't see why you're still complaining, and why you think you still have a problem. It's all been handed to you on a platter.

I have those files. I was just using them as an example. They were required from a sketch I copied from a book on Arduino. I know there no longer part of the core, but a lot of books out there still refer to them.

My problem is with the library, there are programs there that I will need for other sketches. Like LedControl . The one for MAX7219 chip.

Am sorry but I can't seam to keep a single strait thought in my head.

I'll return tomorrow night.

Once again thanks for hanging in with me.

Naneen:
My problem is with the library, there are programs there that I will need for other sketches. Like LedControl . The one for MAX7219 chip.

I think the first thing to do is correct your usage of the word 'library' because it's confusing the issue.
The files you download for a specific purpose, like "Matrix" for example, are called "libraries".
The Arduino Playground is not a library - it's just a group of web pages with lists of, documentation for and links to libraries.
"LedControl" is a library, not a program.

Now to the "LedControl" library. When you navigate the the 'Playground' page with documentation on that library, here, you only need to click on the link titled "Sourcecode and download" near the top of the page, and you'll be taken to a link to the download page. The link is labelled "LedControl Release Page", and takes you to the download page on GitHub where it's hosted. The GitHub page is here:- LedControl-1.0.6, and the actual download link (to the zip file) can be found on that page.
I suspect that you're just not spending enough time reading the documentation on each library's information page. It's all very straightforward.

Edit: Actually, in the case of the "LedControl" library, you're lucky - it can be installed directly from the IDE.
Open the IDE and click on >Sketch >Include Library >Manage Libraries then if you search through the list you'll find the "LedControl" library. Just select it and click "Install". Easy.
(I left my earlier instructions because they will help with finding other libraries I hope.)

Thank you for the Ledcontrol. I have installed the program. I guess the term library is messing with me. I assume that the titles there are the programs there self. I follow your path to LedControl and it is much clear now for that one. It actually has a zip file there. And yes I maybe in too much of a hurry. The GitHub page is a new confusing page for me.

Off topic:

When I was working I program industrial controllers (PLC). Sometimes I was required to write documentation for new procedures, I always had people asking what I mean. I was clear as the sky to me. Now I feel like the shoe is on the other foot. I the layman.

I'll be back later to night.

Hello , I'm back. Thank you for hanging in there. Still confused over this library issue. I think I understand that the library is not the library where the zip files reside. But is simply an exclamation of what the sketches are. For the time being I think I will avoid this until I know more.

I notice as I browse though the various categories that I see little on the subjects that I need help with. I don't give up too easy.

I have two more areas where I need assistance. Then I'll take a rest and read another book on Arduino. Someday I'll catch up with your knowledge.

First problem AVR/pgmspace. From the Manage Libraries, I found avr version unknown installed. So I open the library folder and there is the file pgmspace. This is a C++ file. I think I found this earlier when I was fumbling around.

The second is how to make a .h file. At this location Gammon Forum : Electronics : Microprocessors : Interfacing LED displays with the MAX7219 driver

There is a font file that the author said to put in to a font.h file. Once again I don't know how.

I copy and paste this file in Arduino and tried to save as .h that did not work.

In fact the 8x8 matrix sketch there is what I have been trying get up an running.

Any help?

Naneen:
I think I understand that the library is not the library where the zip files reside.

Actually, the zip files that you download are the libraries. The place where you download the zipped libraries from is not itself a library.

But is simply an exclamation of what the sketches are.

No, a library is not a sketch. Although most libraries do include sample sketches in their “Examples” folder.

For the time being I think I will avoid this until I know more.

It’s good to learn these terms as soon as possible, so that people know what you’re talking about. :slight_smile:

I notice as I browse though the various categories that I see little on the subjects that I need help with. I don’t give up too easy.

Quite right - many libraries are poorly documented, and even the example sketches are fairly brief and don’t illustrate the use of all of the libraries functions. Nick’s website is a rare exception - he explains things very well in my opinion.

First problem AVR/pgmspace.

You shouldn’t have a problem with this. It’s just a header that’s included with the IDE. You don’t need to install anything.

From the Manage Libraries, I found avr version unknown installed. So I open the library folder and there is the file pgmspace. This is a C++ file. I think I found this earlier when I was fumbling around.

Ignore stuff like “avr version unknown” for now. It’s not important. “installed” means that it’s already installed. No problems there.

The second is how to make a .h file. At this location Gammon Forum : Electronics : Microprocessors : Interfacing LED displays with the MAX7219 driver
There is a font file that the author said to put in to a font.h file. Once again I don’t know how.
I copy and paste this file in Arduino and tried to save as .h that did not work.

The “font.h” file is a ‘header’ file that you include in your sketch. It is created more or less as you tried, but there’s a little more to it.
To avoid ‘multiple definition’ errors, you need to ensure that the header can only be included once in your sketches. For instance, in the case of the “font.h” file you refer to, you would do this:-

#ifndef _FONT_H    // If _FONT_H has not previously been defined
#define _FONT_H   // Define it and add the following code. If it was defined already, the code is not added to your sketch.

// The code would go here

#endif  // This is the end of the conditional.

Also, “Arduino.h” needs to be included near the top of the “font.h” header file, or the ‘byte’ type will not be recognised. An alternative is to place this at the beginning of your sketch:-

typedef uint8_t byte;

You don’t need to do this either - I already did everything necessary to make this code compile.
Take a look at the completed “font.h” file in the attached sketch folder to see how the finished code looks.

In fact the 8x8 matrix sketch there is what I have been trying get up an running.

You would copy the sketch code into your *.ino file, and place the file “font.h” in the sketch folder, and then it will be included when #include “font.h” is placed near the top of your sketch. I’ll attach a full working version of this code, so you won’t need to do any of this. I’m just explaining it so you know what’s been done.

Another point, in later versions of the IDE, the code in “font.h” will only compile if the bit patterns are defined as ‘const’.
So I changed this:-

byte cp437_font [256] [8] PROGMEM = {

to this:-

const byte cp437_font [256] [8] PROGMEM = {

Nick’s code was apparently written for earlier versions of the IDE. It was written 4 years ago.

The complete “font.h” file is fairly long, so I won’t place the code in this post. Instead, I’ve attached the whole project, in *.zip format. I put together the “font.h” file, then tested the code in my IDE and it compiles fine. I’m using IDE V1.6.5, and compiled for both UNO and Mega2560 to test it. It compiles without errors.
You just need to download it and unzip it. Let me know if you have any problems. Good luck.:slight_smile:

LEDMatrix8x8.zip (4.03 KB)

Once again thank you for hanging in there with me. The sketch compiled with out error. YEA!!! Sorry got carried away. I see the header was created in C++ is that correct?

I notice as I browse though the various categories that I see little on the subjects that I need help with. I don't give up too easy

From your answer I think you misunderstood me. I was referring to the Forum. I don't see a lot of people asking for help with the basics like I am. When I do a search I fail to find any one else asking for help with libraries.

By the way I have V 1.6.7.

The code complied OK. but my LED is not lighting the way it should.

I recheck my wiring several times. All looks fine. The 8x8 matrix lights all the LEDs at the same time.

When looking at the 8x8 matrix upside down. With the numbers facing me pin 1 is on the right. Pin 16 is directly across from it.

Well my supplies will arrive today (I hope) with new hookup wires. I'll rewire it and go from there.

Thanks again.

Naneen:
I see the header was created in C++ is that correct?

Yes. Generally speaking, Arduino is C++. (Some libraries are C though.)

From your answer I think you misunderstood me. I was referring to the Forum. I don't see a lot of people asking for help with the basics like I am. When I do a search I fail to find any one else asking for help with libraries.

I see a number of questions relating to libraries. But they're not as common as general programming questions.

The code complied OK. but my LED is not lighting the way it should.

I've never tested it, but I assume that Nick's code is good, so it must be a connection problem. I'm afraid that I can't help sort that side out.

Well to parts arrived today. One of the things that order was an SPI interface for the MAX7219. After putting it together all is well. The 8x8 matrix that I had was bad. The interface came with a new one and it works great. When I swap out the two 8x8 matrixes, the first one is always all lite up. If I try to flip it I get a lot of garage, put the new one in and all is fine.

I bought the Arduino Starter Kit. The first kit I got was from OddWires. I've been struggling every since. maybe now I'll get somewhere.

LarryD help me with 4 digit 7 segment display. once it was up and running I had a blast with it. I think I'm on the right trail here. I found a data sheet on the MAX 7219 that I could read.

Once again a million thanks.

Hope you have some hair left.

Naneen:
..... put the new one in and all is fine.

Excellent, I'm pleased that it's working now.

Hope you have some hair left.

A little bit - see my profile pic. :smiley: