Go Down

Topic: Continous Servo Program (Read 641 times) previous topic - next topic


#include <Servo.h>
int main()
  Servo blue;

void setup()

void loop() {

Why is the program kirking out?
Error message: blue was not declared in this scope.


Drop the main(), put the declation of Servo in setup() - basically, the error message is telling you it knows nothing about the Servo declaration in main() (which I am sure is overwritten anyhow by the IDE - main() is built for you behind the scenes).
I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.


The way you've written it, blue is a local variable in the main function. You probably want to declare it in the global scope, outside of any function.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131