Biorobotica TIC / Mbed 2 deprecated Servo

Dependencies:   Servo mbed biquadFilter

main.cpp

Committer:
TimLu
Date:
2018-10-08
Revision:
0:98ae3feb778c
Child:
1:93a041e62d7e

File content as of revision 0:98ae3feb778c:

// Continuously sweep the servo through it's full range
#include "mbed.h"
#include "Servo.h"
 
Servo myservo(D1);

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