Hi
i have verified Arduino can successfully compile a simple LED hello world sketch.
Then i installed to my user-libraries folder D:\Documents\Arduino\libraries\Adafruit_PWMServoDriver, according to instructions here, under "Using the Adafruit Library".
But, trying to compile the code below, i receive the following error:
#include <USI_TWI_Master_Wire.h>
#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>
Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();
#define MIN_PULSE_WIDTH 650
#define MAX_PULSE_WIDTH 2350
#define DEFAULT_PULSE_WIDTH 1500
#define FREQUENCY 50
uint8_t servonum = 0;
void setup()
{
pwm.begin();
pwm.setPWMFreq(FREQUENCY);
// apply PW's
pwm.setPWM(0, 0, pulseWidth(0));
delay(1000);
pwm.setPWM(0, 0, pulseWidth(120));
delay(500);
pwm.setPWM(0, 0, pulseWidth(90));
delay(1000);
}
int pulseWidth(int angle)
{
int pulse_wide, analog_value;
pulse_wide = map(angle, 0, 180, MIN_PULSE_WIDTH, MAX_PULSE_WIDTH);
analog_value = int(float(pulse_wide) / 1000000 * FREQUENCY * 4096);
return analog_value;
}
void loop() {
}Arduino: 1.8.5 (Windows 8.1), Board: "Digispark (Default - 16.5mhz)"
In file included from D:\Documents\Circuit Launch Lights\PCA9685\create-servo-sketch_jan03a\create-servo-sketch_jan03a.ino:3:0:
D:\Documents\Arduino\libraries\Adafruit_PWMServoDriver/Adafruit_PWMServoDriver.h:53:35: error: expected ')' before '*' token
Adafruit_PWMServoDriver(TwoWire *I2C, uint8_t addr = 0x40);
^
D:\Documents\Arduino\libraries\Adafruit_PWMServoDriver/Adafruit_PWMServoDriver.h:63:3: error: 'TwoWire' does not name a type
TwoWire *_i2c;
^
exit status 1
Error compiling for board Digispark (Default - 16.5mhz).
Verbose errors included in next post.
Any ideas?
thx