Problem adding library

I’m having trouble adding libraries, it doesn’t get recognized by the compiler when i add it like so:
IMG attached

#ifndef sfdk_h
#define sfdk_h
#include "Arduino.h"

#endif

sfdk.jpg

...doesn't get recognized...

Reading glasses. Your compiler needs a pair. Works for me every time.

How so?

The point is that "doesn't get recognized" tells us nothing about the actual problem.

Are you saying you are getting a compilation error? That the program builds but clearly is not including the code you expect to be included? That syntax highlighting is not working? That the compiler is whining about its myopia?

The program doesn’t include the libraries i created, i had tested it before on a DC motor i had to simplify some stuff, adding functions like motor.FWD(); but for some reason when i wanted to try again today it just doesn’t do anything. It compiles with no errors

EDIT: sorry

rev1:11: error: ‘Motor’ does not name a type
rev1:12: error: ‘Motor’ does not name a type
rev1.ino: In function ‘void loop()’:
rev1:20: error: ‘motorIzquierdo’ was not declared in this scope
rev1:21: error: ‘motorDerecho’ was not declared in this scope

#include <motor.h>
Motor motorIzquierdo(0,1);
Motor motorDerecho(2,3);

void setup()
{
}

void loop()
{
  motorIzquierdo.Adelante();
  motorDerecho.Adelante();
  delay(3000);
  motorIzquierdo.Atras();
  motorDerecho.Atras();
  delay(3000);
  motorIzquierdo.Parar();
  motorDerecho.Parar();
  delay(3000);
}

Link to the library?

#ifndef motor_h
#define motor_h
#include "Arduino.h"

class Motor
{
  public:
    Motor(int pin1, int pin2);
	void Adelante();
	void Atras();
	void Parar();
	int Estado();
  private:
    int _pin1,_pin2,_flag;
};
#endif
#include "Arduino.h"
#include "Motor.h"

int _flag;

Motor::Motor(int _pin1, int _pin2)
{
	pinMode(_pin1, OUTPUT);
	pinMode(_pin2, OUTPUT);
	Motor::Parar();
}

int Motor::Estado()
{
	return _flag;
}

void Motor::Parar()
{
	digitalWrite(_pin1, LOW);
	digitalWrite(_pin2, LOW);
	_flag = 0;
}

void Motor::Adelante()
{
  digitalWrite(_pin1, HIGH);
  digitalWrite(_pin2, LOW);
  _flag = 1;
}

void Motor::Atras()
{
  digitalWrite(_pin1, LOW);
  digitalWrite(_pin2, HIGH);
  _flag = 2;
}

When you add a library, you need to close and re-start the IDE.

It’s also a really good idea to make the file names EXACTLY match the class name. The files should be Motor.cpp and Motor,h, not motor.cpp and motor.h.

When you add a library, you need to close and re-start the IDE.

That depends on where you add the library. Add it to the libraries folder, and yes the IDE needs to be restarted. Add it to the sketch folder, using the create tab option, and no, it does not need to be restarted.

PaulS:
It's also a really good idea to make the file names EXACTLY match the class name. The files should be Motor.cpp and Motor,h, not motor.cpp and motor.h.

Typo, they are actually named Motor.cpp and Motor.h and in ~/Documents/Arduino/Libraries folder

PaulS:

When you add a library, you need to close and re-start the IDE.

That depends on where you add the library. Add it to the libraries folder, and yes the IDE needs to be restarted. Add it to the sketch folder, using the create tab option, and no, it does not need to be restarted.

I did restart every time i tried to add it. And for some reason i followed your advise of adding it to the sketch and it turns out it says i'm declaring classes twice which means it actually added the library after i added the file to the sketch, i just deleted the sketch and it seems to work again. Wierd?
Well, at least it works now, thanks everyone!