How do I download this zip file?

I have recently got hold of an e-book called Practical Arduino.
In it I am invited to download the zip file from here
When I go to sketch/include library/add .zip library it tells me the specified folder/zip file does not contain a valid library.
I assume this is because the zip file contains lots of files in separate folders.
For now all I want is the file ps2-mouse in the ps2 keyboard directory, can I just load that one into the IDE or how do I go about loading any or all the files into the IDE?

Download the ZIP file to your Downloads folder, from there you can extract the folder of interest to your Arduino libraries folder.

Here is a direct link to the file...

... but you should download the whole zip folder by going to the link you show, clicking the green <> CODE dropdown button, then clicking "Download ZIP"... once downloaded, go to your IDE >> SKETCH >> INCLUDE LIBRARY >> ADD ZIP LIBRARY >> (find your download)

1 Like

Sorry, maybe I should have made myself a little clearer.
I downloaded the zip file from the github site and from sketch pulldown I tried to load the zip file.
I was met with

the specified folder/zip file does not contain a valid library.

I have, since then, gone into the zip file found a folder named code within it I found the mouse folder, extracted it, zipped it and loaded that into the IDE successfully.
I assume this is a case of the contributor offering something without testing it or assuming the user will know that it doesn't load as it is supposed to and has to be done individually?

The files on your link doesn't contain an Arduino library ( libraries). There is a collection of separate Arduino sketches. So you can just open it as sketches rather than install as libraries.

There is no library.

  1. Open the zip.
  2. Inside this zip, you will see a folder "practical-arduino-master"
  3. Inside that folder you will find a "code" folder.
  4. Inside "code" folder, you will find fourteen folders for chapters 2 through 15.
  5. Either drag-and-drop the "code" folder, or copy/paste the fourteen chapter folders, into your "sketches" folder.
  6. Inside the chapter folders, launch an Arduino sketch with the extension .PDE
  7. Your IDE should have the sketch now... and inside that sketch you will see the library (libraries) you will need.

Try it. Report your findings.

I can't find a 'sketches' folder on my computer?
I opened the mouse folder, extracted it from the zip file and zipped the mouse folder.
I then went to sketch/include library/add zip library, it said it had succeeded but I can't find it in examples?
I can find it in sketch/include library but clicking on that just adds
#include <PS2Mouse.h>
into the sketch I have open at the time.
If I manually load it into the IDE and try to compile it it fails with

c:\Users\User\Documents\Arduino\libraries\PS2-Mouse\PS2Mouse.cpp:1:10: fatal error: WConstants.h: No such file or directory
#include "WConstants.h"
^~~~~~~~~~~~~~
compilation terminated.
exit status 1

I assume I need to get a file called 'WConstrants.h'
which I can't find,

I also thought the github file was designed to be loaded into the IDE as a zip file?

The "sketches" folder is usually named "sketchbook".
What is your operating system (OS), Windows, MAC, Linux, ...?

right!
Found the sketchbook folder, added the mouse folder and it now loads from my sketchbook pulldown in file.
It is also in my examples folder but doesn't show when I go to examples from the file pulldown?
It still fails due to not having the WConstraints.h file present.
I am using windows 10 and IDE 2.3.0

Replace any occurrence of #include "WConstants.h" to #include <Arduino.h>

For some reason I have more than one instance of a library directory holding ps2mouse.cpp files.
When I corrected one it led me to the fact that another one was wrong and so on till I corrected all of them?
It now compiles so I will set up some hardware and see if it works.
Thanks for the assistance.