Yosuke Kirihata / Mbed 2 deprecated Nucleo_extended_servo

Dependencies:   mbed

Committer:
YosukeK
Date:
Sat Sep 20 06:50:43 2014 +0000
Revision:
1:74a29b62a144
Parent:
0:916047fa0d8b
Child:
2:812701011676
Second commit.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
YosukeK 0:916047fa0d8b 1 #include "mbed.h"
YosukeK 1:74a29b62a144 2 #include "ExtendedServo.h"
YosukeK 0:916047fa0d8b 3
YosukeK 0:916047fa0d8b 4 DigitalOut myled(LED1);
YosukeK 0:916047fa0d8b 5
YosukeK 0:916047fa0d8b 6 int main() {
YosukeK 0:916047fa0d8b 7
YosukeK 1:74a29b62a144 8 //PwmServo a(PB_8);
YosukeK 1:74a29b62a144 9 ExtendedServo b(PB_10, 170, 5, 90, false);
YosukeK 1:74a29b62a144 10
YosukeK 1:74a29b62a144 11 while(1) {
YosukeK 1:74a29b62a144 12 // a.setAngle(54);
YosukeK 1:74a29b62a144 13 //b.setAngle(-90);
YosukeK 1:74a29b62a144 14 //wait_ms(2000);
YosukeK 1:74a29b62a144 15 b.setAngle(0);
YosukeK 1:74a29b62a144 16 //wait_ms(2000);
YosukeK 1:74a29b62a144 17 //b.setAngle(90);
YosukeK 1:74a29b62a144 18 //wait_ms(2000);
YosukeK 1:74a29b62a144 19 //b.setAngle(0);
YosukeK 1:74a29b62a144 20 //wait_ms(2000);
YosukeK 1:74a29b62a144 21
YosukeK 1:74a29b62a144 22 for (int i = -90; i < 90 ;i++) {
YosukeK 1:74a29b62a144 23 b.setAngle(i);
YosukeK 1:74a29b62a144 24 wait_ms(10);
YosukeK 1:74a29b62a144 25 }
YosukeK 1:74a29b62a144 26 for (int i = 90; i > -90; i--) {
YosukeK 1:74a29b62a144 27 b.setAngle(i);
YosukeK 1:74a29b62a144 28 wait_ms(10);
YosukeK 1:74a29b62a144 29 }
YosukeK 1:74a29b62a144 30
YosukeK 1:74a29b62a144 31 }
YosukeK 0:916047fa0d8b 32 }