Does not name a type?

What does it mean when it says 'myservo1' does not name a type

#include <Servo.h>
Servo myservo1;

int pos = 0;

void setup() {
  myservo1.attach(8);
}

void loop() {
    myservo1.write(50);
    delay(15);
  }
    myservo1.write(75);
    delay(15);
  }
}

The loop function ends on the line above the error so that code isn't in any function and baffles the compiler.

That will be much more obvious if the OP uses ctrl-t to properly format their code. As it is, it looks like there's room for another level of indentation, when there isn't.

Note you have 3 right-braces here, only the first one is matched to a left brace.
Get rid of the first two, so that all your loop() code is between on PAIR of braces and it should compile.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.