We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
#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){ }}
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?
Looks like you have simply imported an Arduino Servo sketch (incompletely copied from here?). It's missing more than a few pieces, including the #include "Servo.h" that would define the Servo class (which would be part of the Servo package). The FRDM is not an Arduino and the Arduiino development environment hides a lot of boilerplate code that you would have to supply to make this work. All is not lost, though -- try searching for FRDM-KL25Z arduino on Google and you'll find some useful resources to help. For example, Planet Arduino.