Hello, how do i solve this error now that i'm testing my library.
I followed the discussion here SOLVED: Problem compiling code error: "undefined Reference to 'Timer1'" - Programming Questions - Arduino Forum but it didn't go away.
Here is my code.
#ifndef _Car_h
#define _Car_h
#if ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
#include <../Adafruit_PWMServoDriver/Adafruit_PWMServoDriver.h>
class Car{
public:
Car();
void turnLeft();
...
Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();
...
};
#endif
Car.cpp
#include "Car.h"
Car::Car(){
setLargestCornerAngle(17);
}
...
void Car::turnLeft(){
...
int pulselength = map(90-17, 0, 180, SERVOMIN, SERVOMAX);
pwm.setPWM(servonum, 0, pulselength);
}
}
Using the car object
#include <Car.h>
Car car;
void setup() {
}
void loop() {
}