Please Help: Creating a Library

Im trying to make a library to use with a 12x12 LED matrix I built. I Keep getting error:

“Matrix” is the name of the library.
“Matrix_12” is the name of the program.
if that was unclear :stuck_out_tongue:

Compiling 'Matrix_12' for 'Arduino Uno'
Matrix_12.ino:In function 'void loop()'
Matrix_12.ino:18: error: 'Matrix' was not declared in this scope
Error compiling

Here is the .ino code:
(just trying to get the library to work.)

#include <Matrix.h>

void setup()
{	
	Serial.begin(9600);
}

void loop()
{
Matrix.run(100);
}

Here is the .h code:

#ifndef Matrix_H
#define Matrix_H

#include "Arduino.h"




class Matrix {
	public:
	Matrix();
	void run(int RUNTIME);

	private:
	void scan();
	void address(int y, int x);
};

#endif

Last but not least, here is the .cpp code:
(it gets a little funky because I’m using 3 shift registers to control the matrix)

#include "Arduino.h"
#include "Matrix.h"

#define LATCH_PIN 11
#define CLOCK_PIN_1 10
#define CLOCK_PIN_2 A1
#define CLOCK_PIN_3 A3
#define DATA_PIN_1 12
#define DATA_PIN_2 A0
#define DATA_PIN_3 A2

int COL[12] = {8, 4, 2, 1, 16, 32, 64, 128, 1, 2, 4, 8};
int ROW[12] = {127, 191, 223, 239, 247, 251, 253, 254, 255-128, 255-64, 255-32, 255-16};
int FCOl[]={8,4,2,1};
int FROW[]={0,0,0,0,0,0,0,0,128,64,32,16};


boolean SCREEN[][12]={
	{1,1,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,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},
	{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,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,0,0},
};

Matrix::Matrix(){
	pinMode(LATCH_PIN, OUTPUT);
	pinMode(DATA_PIN_1, OUTPUT);
	pinMode(DATA_PIN_2, OUTPUT);
	pinMode(DATA_PIN_3, OUTPUT);
	pinMode(CLOCK_PIN_1, OUTPUT);
	pinMode(CLOCK_PIN_2, OUTPUT);
	pinMode(CLOCK_PIN_3, OUTPUT);
}

//Matrix::Matrix(){/*nothing to destruct*/}

void Matrix::address(int y, int x)
{
	
	/* upper right 8x8  */
	if (y < 8 && x > 3) {
		digitalWrite(LATCH_PIN, LOW);
		shiftOut(DATA_PIN_3, CLOCK_PIN_3, MSBFIRST, ROW[y]);
		shiftOut(DATA_PIN_1, CLOCK_PIN_1, MSBFIRST, COL[x]);
		shiftOut(DATA_PIN_2, CLOCK_PIN_2, MSBFIRST, 240);
	}
	/* bottom right 4x8 strip */
	else if (y >= 8 && x > 3) {
		digitalWrite(LATCH_PIN, LOW);
		/* TEST test Test TesT tESt*/	shiftOut(DATA_PIN_2, CLOCK_PIN_2, MSBFIRST,ROW[y]-15);
		shiftOut(DATA_PIN_3, CLOCK_PIN_3, MSBFIRST,255);
		shiftOut(DATA_PIN_1, CLOCK_PIN_1, MSBFIRST,COL[x]);
	}
	/* upper left 4x8 strip */
	else if (y < 8 && x <= 3) {
		digitalWrite(LATCH_PIN, LOW);
		shiftOut(DATA_PIN_2, CLOCK_PIN_2, MSBFIRST,240+COL[x]);
		shiftOut(DATA_PIN_3, CLOCK_PIN_3, MSBFIRST,ROW[y]);
		shiftOut(DATA_PIN_1, CLOCK_PIN_1, MSBFIRST,0);
	}
	/* fucked corner */
	else {
		digitalWrite(LATCH_PIN, LOW);
		shiftOut(DATA_PIN_2, CLOCK_PIN_2, MSBFIRST,FCOl[x]+240-FROW[y]);
		shiftOut(DATA_PIN_3, CLOCK_PIN_3, MSBFIRST,255);
		shiftOut(DATA_PIN_1, CLOCK_PIN_1, MSBFIRST,0 );
	}
	digitalWrite(LATCH_PIN, HIGH);
}

void Matrix::run(int RUNTIME){
	
	int starttime = millis();
	int endtime = starttime;
	while ((endtime - starttime) <=RUNTIME)
	{
		scan();
		endtime = millis();
	}

	
}

void Matrix::scan(){
	for (int x=0;x<12;x++)
	{
		for (int y=0;y<12;y++)
		{
			if (SCREEN[y][x]>0)
			{
				address(y,x);
			}
		}
	}
}

Thanx.

Matrix is the name of your class. The compiler is expecting an instance of this class for the call to run(). Try something like this...

Matrix myMatrix;

void loop()
{
  myMatrix.run(100);
}