DOUBLE SERVO

servo two

#include <Servo.h>

Servo head1;
Servo head2;
int sensorPin1 = A0;
int sensorValue1 = 0;
int sensorPin2 = A1;
int sensorValue2 = 0;
int angle1 = 0;
int angle2 = 0;
void setup()
{
head1.attach(7);
head1.write(80);
head2.attach(8);
head2.write(80);
pinMode(sensorPin1,INPUT);
pinMode(sensorPin2,INPUT);
Serial.begin(9600);

}
void loop(){
float sensorValue1 = analogRead(sensorPin1);
int angle1 = (sensorValue1/1023)*180;
Serial.print(angle1);
head1.write(angle1);
Serial.print(” “);

float sensorValue2 = analogRead(sensorPin2);
int angle2 = (sensorValue2/1023)*180;
Serial.println(angle2);
head2.write(angle2);
}