Embedded system Fun Blog
























































Find out all the best information, libraries and circuit about the latest Embedded systems.

Saturday, 7 January 2012

MBED Example: How controlling a Radio Control model Servo (RC)

.from: http://mbed.org/cookbook/Servo

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

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

Servo myservo(p21);

int main() {    
    for(float p=0; p<1.0; p += 0.1) {
        myservo = p;
        wait(0.2);
    }
}
 
/media/uploads/simon/servoschematic.png /media/uploads/simon/servophoto.jpg
 

No comments:

Post a Comment