Servo_Demo

Dependencies:   mbed Servo

main.cpp

Committer:
EduRemo
Date:
2016-02-05
Revision:
0:3d38b95d74a0
Child:
1:21aeba9a6128

File content as of revision 0:3d38b95d74a0:

// Hello World to sweep a servo through its full range

#include "mbed.h"
#include "Servo.h"

Servo myservo(PTC1);


int main() {   
    while(1) {
          for(int i=0; i<=100; i++) {
              myservo = i/100.0;
              wait(0.1);
          }
          for(int i=99; i>=0; i--) {
              myservo = i/100.0;
              wait(0.1);
          }
      }
}