Library trouble (17)

Read the instructions below, but am still having no luck.

Set up a folder called “libraries” in admin>documents>aduino, but when I zip libraries in there they still don’t show up in the menu.

for example, iv downloaded the Pattern.h from here

then unpacked the files Pattern.h, textScroll.pde into admin>documents>aduino/libraries

but when i load the sketch i get

21: error: Pattern.h: No such file or directory In function ‘void scrollString(char*)’:
Bad error line: -5

full code

/* 29 mar 09 */
/* Text scrolling with a 5x7 led matrix.
/* ATTENTION: Copy Pattern.h file in ./hardware/libraries/Pattern/ directory */

#include <avr/pgmspace.h>
#include <Pattern.h>
#define DELAY 100

int dataIn = 2;
int load = 4;
int clock = 3;

int matrix[7][5]={{0,0,0,0,0},{0,0,0,0,0},{0,0,0,0,0},{0,0,0,0,0},{0,0,0,0,0},{0,0,0,0,0},{0,0,0,0,0},};

int e = 0;     // just a varialble

// define max7219 registers
byte max7219_reg_noop        = 0x00;
byte max7219_reg_digit0      = 0x01;
byte max7219_reg_digit1      = 0x02;
byte max7219_reg_digit2      = 0x03;
byte max7219_reg_digit3      = 0x04;
byte max7219_reg_digit4      = 0x05;
byte max7219_reg_digit5      = 0x06;
byte max7219_reg_digit6      = 0x07;
byte max7219_reg_digit7      = 0x08;
byte max7219_reg_decodeMode  = 0x09;
byte max7219_reg_intensity   = 0x0a;
byte max7219_reg_scanLimit   = 0x0b;
byte max7219_reg_shutdown    = 0x0c;
byte max7219_reg_displayTest = 0x0f;

void putByte(byte data) {
  byte i = 8;
  byte mask;
  while(i > 0) {
    mask = 0x01 << (i - 1);      // get bitmask
    digitalWrite( clock, LOW);   // tick
    if (data & mask){            // choose bit
      digitalWrite(dataIn, HIGH);// send 1
      digitalWrite(dataIn, LOW); // send 0
    digitalWrite(clock, HIGH);   // tock
    --i;                         // move to lesser bit

void sendToMax( byte reg, byte value) {    
  digitalWrite(load, LOW);       // begin     
  putByte(reg);                  // specify register
  digitalWrite(load, LOW);       // and load da shit

void setup () {
  //wired up to max7219
  pinMode(dataIn, OUTPUT);
  pinMode(clock,  OUTPUT);
  pinMode(load,   OUTPUT);
  //initiation of the max 7219
  sendToMax(max7219_reg_decodeMode, 0x00);  // not using  digits
  sendToMax(max7219_reg_scanLimit, 0x06); //scan rows 1 2 3 4 5 6 7 
  sendToMax(max7219_reg_shutdown, 0x01);    // not in shutdown mode
  sendToMax(max7219_reg_displayTest, 0x00); // no display test
  sendToMax(max7219_reg_intensity, 0xf);     // range: 0x00 to 0x0f
  for (e=1; e<=7; e++) {    // empty registers, turn all LEDs off

//I don't know why pow function doesn't work correctly.
//So i prefer to write my personal version of this.
int power(int base, int ex){
int i=1;
int tot=1;
if(i==0) return(1);

void lightOn(){
int i,j,k;

   //light on matrix
     if(matrix[i][j]==1) k=k+power(2,j); 

void scrollChar(const int pattern[7][5]){

    int i,j,k=0;

while(k<5)    //column of pattern
    //shift rigidly columns from right to left
    for(j=0;j<4;j++){  //column
      for(i=0;i<7;i++){  //row
      matrix[i][j]= matrix[i][j+1];
    //queue k-th column of pattern
    for(i=0;i<7;i++){  //row
}//end while


//insert a space (two column filled with zeros) beetween two chars
void insertSpace(){
 int i,j,k=0;

while(k<2)    //queue two column of zero
    //shift rigidly columns from right to left
    for(j=0;j<4;j++){  //column
      for(i=0;i<7;i++){  //row
      matrix[i][j]= matrix[i][j+1];
    //queue two column filled with zeros
    for(i=0;i<7;i++){  //row
}//end while

void scrollString(char * s){
int i=0;
   while (s[i])
    //symbols and letters
    if(s[i]==' ')


}//end while

void loop () {
    scrollString("ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789");   //use capital letters         

To install, unzip the library to a sub-directory of the libraries sub-directory of your Arduino sketchbook directory (shown in the Arduino preferences dialog). If this is the first library you’ve installed, you’ll need to create the libraries directory. After unzipping the library, (re-)launch the Arduino environment; you should see the library in the Import Library menu.

Did you put the Pattern.h file directly into the libraries folder? You'll need an intermediate folder, like: Pattern/