Exp5_RCservo

Dependencies:   mbed Servo

Committer:
ddamato31
Date:
Tue Aug 02 22:11:51 2011 +0000
Revision:
0:cb060c40c1ee

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ddamato31 0:cb060c40c1ee 1 // Calibrate RC Servo by change offset value (-250 < offset < 250)
ddamato31 0:cb060c40c1ee 2 #include "mbed.h"
ddamato31 0:cb060c40c1ee 3
ddamato31 0:cb060c40c1ee 4 PwmOut Servo(p22);
ddamato31 0:cb060c40c1ee 5
ddamato31 0:cb060c40c1ee 6
ddamato31 0:cb060c40c1ee 7 int main() {
ddamato31 0:cb060c40c1ee 8 int offset = -100;
ddamato31 0:cb060c40c1ee 9 Servo.period_us(20000);
ddamato31 0:cb060c40c1ee 10 Servo.pulsewidth_us(1500 + offset);
ddamato31 0:cb060c40c1ee 11 while(1) {
ddamato31 0:cb060c40c1ee 12 Servo.pulsewidth_us(1500 + offset);
ddamato31 0:cb060c40c1ee 13 }
ddamato31 0:cb060c40c1ee 14 }