f

Dependencies:   Servo mbed

TestServo.cpp

Committer:
EpicG10
Date:
2017-04-12
Revision:
1:871a9b15f62f
Parent:
0:f537081d4282

File content as of revision 1:871a9b15f62f:


// Continuously sweep the servo through it's full range
#include <mbed.h>
#include "Servo.h"

Servo myservo(PC_7);

int main()
{
    myservo.calibrate(0.0015, 180.0);
    while(1) {
        
        for(int i=0; i<135; i+=1) {
            myservo.position(65-(float)i);
            wait(0.04);

        }
        for(int i=0; i<135; i+=1) {
            myservo.position(-70.0+(float)i);
            wait(0.04);
        }
        

    }
}