in my folder whith sketch there is 2 files:
car.cpp:
#include "Arduino.h"
#include "car.h"
car::car() {
// Инициализация, если необходимо
}
void car::moveForward() {
analogWrite(3, 255);
analogWrite(7, 255);
}
void car::moveBackward() {
analogWrite(4, 255);
analogWrite(5, 255);
}
void car::stop() {
analogWrite(3, 0);
analogWrite(4, 0);
analogWrite(5, 0);
analogWrite(7, 0);
}
and car.h:
#ifndef car_h
#define car_h
#include "Arduino.h"
class car{
public:
car();
void moveForward();
void moveBackward();
void stop();
private:
};
#endif
when i import:
#include <car.h> (also tried "car.h" whith that brakets)
but encountering err: Compilation error: car.h: No such file or directory
one more step i tried is put both files in one "car" folder and moved it to the libraries arduino folder which included other folders whith libraries
but it didn't work either