I am creating my own library for the Arduino and I have the following code:
#include <Arduino.h>
#include <Servo.h>
class ServoMotorController {
public:
ServoMotorController(int servoPin, int motorPin, int angle);
void setAngle(int angle);
void setSpeed(int speed);
private:
Servo servo;
int servoPin;
int servoAngle;
int motorPin;
int motorSpeed;
};
I am getting the error that Servo
does not name a type; however if I do
#include <Servo.h>
#include <ServoMotorController.h>
in my actual Arduino code then I do not get the error. Why is the include statement not working in my C++ lib?
#include <File.h>
and#include "File.h"
.