This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

I'm using the FRDM-KL25Z board to connect servo motor for a project. But I get an error that said error: unknown type name 'Servo'. What is the correct file to #include ("#include "...".h) the file. Im using Keil microvision soft

#include "MKL25Z4.h"

Servo myservo;

static int pos = 0;

void setup(){
myservo.attach(2) //PTA1 pin 2
}

void loop(){
for (pos = 0; pos <= 180; pos += 1){
myservo.write(pos);
}

for (pos = 180; pos >= 0; pos -= 1){
}
}

Parents
  • Please don't put the entire question in the title!

    Note that there is no worldwide, global directory listing what symbols are defined in every single .h file in the world - so there is no way to tell what file you need!

    Where did you think it should be defined? Where did you hear of it?

    Have you tried doing a text search through all the .h files on your hard drive?

Reply
  • Please don't put the entire question in the title!

    Note that there is no worldwide, global directory listing what symbols are defined in every single .h file in the world - so there is no way to tell what file you need!

    Where did you think it should be defined? Where did you hear of it?

    Have you tried doing a text search through all the .h files on your hard drive?

Children
No data