Servo Error

I’m working on a project that incorporates a single servo, and I’m getting this error message that says “Servo does not name a type” after this code:

Servo servoOne;
Does anyone know why this is?

Maybe you need a space between “#include” and “<Servo.h>;”?

What's the semicolon at the end of the #include for?

What’s the semicolon at the end of the #include for?

Wow… good catch. I was at first going to say “It’s there because it’s the end of a statement, silly”, but got to thinking. Checked a bunch of code examples and nary a semicolon after an #include. (I always cut and pasted that part of the code, never actually writing it myself…)

Checking the online language reference I find "Note that #include, similar to #define, has no semicolon terminator, and the compiler will yield cryptic error messages if you add one. " I guess I’m the silly one. :wink:

A useful rule-of-thumb is if you see a semicolon at the end of a line starting with a #, it's probably wrong.

Thanks, that should help. :)