C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/binary.h:31:12: error: expected unqualified-id before numeric constant
#define B1 1
above is the important line of my error message. I am trying to use the adafruit servo shield and a translation of a code that worked for me without it. (actually a few things are different because i am trying to simplify it until I have success in steps. Here is my code.
#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>
Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();
int SERVOMIN = 150;
int SERVOMAX = 600;
int coxa = 56;
int femur = 47;
int tibia = 57;
int x;
int y;
int z;
void setup() {
// put your setup code here, to run once:
pwm.begin();
pwm.setPWMFreq(60);
yield();
}
void loop() {
// put your main code here, to run repeatedly:
int joyx = analogRead(A0);
int joyy = analogRead(A1);
int joyz = analogRead(A2);
int xShift = map(joyx, 0, 1023, -4, 4);
int yShift = map(joyy, 0, 1023, -4, 4);
int zShift = map(joyz, 0, 1023, -4, 4);
x = x + xShift; y = y + yShift; z = z + zShift;
float G = atan(x/y);
float D = (sqrt ((x*x) + (y*y))) + coxa;
float L = sqrt (((D-coxa)*(D-coxa))+(z*z));
float A = acos (((femur*femur)+(tibia*tibia)-(L*L))/(2*femur*tibia));
float B = (acos(((femur*femur)+(L*L)-(tibia*tibia))/(2*femur*L))+acos(((L*L)+(z*z)-((D-coxa)*(D-coxa)))/(2*L*z)));
int G1 = map(degrees(G),0,180,150,600);
int A1 = map(degrees(A),0,180,150,600);
int B1 = map(degrees(B),0,180,150,600);
pwm.setPWM(0, 0, G1);
pwm.setPWM(1,0,B1);
pwm.setPWM(2,0,A1);
}