need some help with this library

im trying to install the stopwatch library from the arduino playground
http://playground.arduino.cc/Code/StopWatchClass
im confused on how to do it.. when i click on the get "get code" button it does not work..
so i decided to copy and paste with my text editor the .h and .cpp file
i created a folder in my arduino libraries folder named "StopWatch" then saved the two files renaming them with the correct extension. this does not appear to work. what am i doing wrong? im using a mac
thanks
matt

You can avoid using libraries.
Select the text with your mouse and copy paste them in files with the same name as in the library in your Arduino project.
The example code uses #include <StopWatch.h>, you have to change that into #include "StopWatch.h", because it is now a project file and not a library.

Exactly where did you put the StopWatch folder ?

UKHeliBob:
Exactly where did you put the StopWatch folder ?

documents/arduino/libraries/StopWatch
StopWatch.h
StopWatch.cpp

is the copy and paste with my text editor how im supposed to do it?

Did you save the sample sketch as: documents/arduino/StopWatch/StopWatch.ino

@Bradshaw106
Note that new libraries only work after closing all IDE's as they are read at the start.

I just copied and pasted the example sketch. I also restarted the IDE
I should mention, the reason I don't think my library is working is because when I try to verify the example sketch I get all kinds of errors..
For example.
Stopwatch not declared in this scope
Stopwatch does not name a type
Lots of errors, probably 15 or so I assumed it was because I didn't load the library correctly? But it seams I did, I will try to debug the code and see what happens

You could make a screendump and crop that and post an image of the first error message.

here are the errors
sketch_jan19a:3: error: 'StopWatch' does not name a type
sketch_jan19a:4: error: 'StopWatch' does not name a type
sketch_jan19a.ino: In function 'void setup()':
sketch_jan19a:11: error: 'STOPWATCH_LIB_VERSION' was not declared in this scope
sketch_jan19a:13: error: 'SWarray' was not declared in this scope
sketch_jan19a.ino: In function 'void loop()':
sketch_jan19a:18: error: 'MySW' was not declared in this scope
sketch_jan19a:62: error: 'StopWatch' has not been declared
sketch_jan19a:65: error: 'StopWatch' has not been declared
sketch_jan19a:68: error: 'StopWatch' has not been declared
sketch_jan19a:78: error: 'SWarray' was not declared in this scope

here is the sample sketch

#include <StopWatch.h>

StopWatch MySW;
StopWatch SWarray[5];

void setup()
{
  Serial.begin(115200);
  Serial.println("Stopwatch demo");
  Serial.print("Version: ");
  Serial.println(STOPWATCH_LIB_VERSION);

  SWarray[0].start();
}

void loop()
{
  Serial.println(MySW.isRunning());
  delay(100);

  MySW.start();
  Serial.println(MySW.isRunning());  
  Serial.println("START 1");
  for(int i=0; i<5; i++)
  {
    delay(10);
    Serial.println(MySW.elapsed());
  }

  MySW.stop();
  Serial.println(MySW.isRunning());
  Serial.println("STOP");
  for(int i=0; i<5; i++)
  {
    delay(10);
    Serial.println(MySW.elapsed());
  }

  MySW.start();
  Serial.println(MySW.isRunning());    
  Serial.println("START 2");
  for(int i=0; i<5; i++)
  {
    delay(10);
    Serial.println(MySW.elapsed());
  }  
  MySW.reset();
  Serial.println(MySW.isRunning());
  Serial.println("RESET");

  MySW.start();
  Serial.println(MySW.isRunning());
  Serial.println("START 3");
  for(int i=0; i<5; i++)
  {
    delay(10);
    Serial.println(MySW.elapsed());
  }

  switch(MySW.state())
  {
    case StopWatch::RESET: 
      Serial.println("reset");  // e.g. disable stop/reset
      break;
    case StopWatch::RUNNING: 
      Serial.println("running"); // display laptime
      break;
    case StopWatch::STOPPED: 
      Serial.println("stopped"); // display finaltime
      break;
    default: 
      Serial.println("unknown");
      break;
  }

  delay(3000);
  Serial.print(" >>>  laptime loop() : ");
  Serial.println(SWarray[0].elapsed());  
}
/code]

I copied the StopWatch.h code from the web site. I opened the Arduino IDE. I created a new tab, StopWatch.h, and pasted the code. I repeated the process for StopWatch.cpp. I pasted the example code in the .ino tab.

Because I am using a borrowed computer, I don't have all the libraries installed, so I deleted all the LiquidCrystal stuff from the sketch. I changed the <> in the StopWatch include statement to "".

Then, I clicked Verify (using 1.0.1). I got this "error" message:

Binary sketch size: 2,892 bytes (of a 32,256 byte maximum)

Hopefully, you'll be able to resolve that on your own.

I just did a copy and paste, created the 3 files and everything worked OK.
I did not change any code. I have Rev3 UNO, IDE 1.03 and Windows 7-64bit
I have:
C:\Users\YourName\Documents\Arduino\libraries\StopWatch\StopWatch.cpp
C:\Users\YourName\Documents\Arduino\libraries\StopWatch\StopWatch.h
C:\Users\YourName\Documents\Arduino\StopWatch\StopWatch.ino

Imgur
thats how to open a new tab