error compiling

I am very new to code and programming. I keep getting this error "'Servo' does not name a type". when I add <servo.h> to it I get a compiling error. Please help me.


#include

Servo myservo1; // create servo object to control a servo
Servo myservo2;
Servo myservo3;
Servo myservo4;
Servo myservo5;

void setup()
{
Serial.begin(9600);

myservo1.attach(2); // attaches the servo on pin 9 to the servo object
myservo2.attach(3);
myservo3.attach(4);
myservo4.attach(5);
myservo5.attach(6);
}

void loop()
{
if(Serial.available() >=5)
{
byte servoAng1 = Serial.read();
byte servoAng2 = Serial.read();
byte servoAng3 = Serial.read();
byte servoAng4 = Serial.read();
byte servoAng5 = Serial.read();


// Send the servo to the position read... (note: you get to make this happen)
myservo1.write(servoAng1);
myservo2.write(servoAng2);
myservo3.write(servoAng3);
myservo4.write(servoAng4);
myservo5.write(servoAng5);
}
}
What does this line mean?

#include
I think its were #include <Servo.h> goes.
I got this code off of someone else so I'm not sure exactly. Ive asked them but they never reply.
And what do you want to do with this code if you even do not know what should be after #include?!
Last edited on
its for an animatronic hand. its for an arduino. Its for the receiving arduino. I'm using an xbee with it.
Topic archived. No new replies allowed.