Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I have made a sumobot with an arduino, an afmotor shield and a 4-pin ping sensor when I upload my code it keeps giving me this error: "'Servo' does not name a type" here is my code.
You are creating Servo objects instead of AF_DCMotor objects. Change this:
AF_DCMotor leftMotor(1); // Change these numbers to the correct motor numbers
AF_DCMotor rightMotor(2); // you are using on the shield
Required, but never shown