i've tried to learn hot to create a new library , i did it all just as explained buy the site and still i had an error showing
this is the error
sketch_oct27a.cpp.o: In function `setup':
C:\Users\hagai\AppData\Local\Temp\build8272096594347651372.tmp/sketch_oct27a.cpp:8: undefined reference to `Led::Led(int)'
this is my code
header:
#ifndef Led_h
#define Led_h
#include "Arduino.h"
class Led
{
public:
Led (int pin);
void on();
void off();
private:
int _pin;
};
#endif
source:
#include "Arduino.h"
#include "Led.h"
Led::Led(int pin)
{
pinMode(pin, OUTPUT);
_pin = pin;
}
void Led::on()
{
digitalWrite(_pin, HIGH);
}
void Led::off()
{
digitalWrite(_pin, LOW);
}
the sketch:
#include <Led.h>
Led led1(13);
void setup()
{
}
void loop()
{
led1.on();
}
thanks in advance