I have a problem were for some reson void loop wont work heres my code
#include <Servo.h>
void setup() {
myservo.attach(9);
Serial.begin(9600);
}
void loop() {
if(Serial.available() > 0){
state = Serial.read();
flag=0;
}
if(state == 0);{
myservo.write(90);}
if (flag == 0){
Serial.println("Curtains Closed");
}
if (state == 1);{
myservo.write(-90);}
if (flag == 0){
Serial.println("Curtains opened");
}
}
This is what I get:
BT_Cartons:3: error: ‘myservo’ was not declared in this scope
Any sugestions