ioTinkers / Mbed 2 deprecated pwmm

Dependencies:   Servo mbed

Committer:
LordGT
Date:
Mon Aug 13 05:37:28 2018 +0000
Revision:
1:9867060b8cea
fsefwef

Who changed what in which revision?

UserRevisionLine numberNew contents of line
LordGT 1:9867060b8cea 1 #include "mbed.h"
LordGT 1:9867060b8cea 2 #include "Servo.h"
LordGT 1:9867060b8cea 3
LordGT 1:9867060b8cea 4 Servo myservo(p21);
LordGT 1:9867060b8cea 5
LordGT 1:9867060b8cea 6 int main() {
LordGT 1:9867060b8cea 7 while(1) {
LordGT 1:9867060b8cea 8 for(int i=0; i<100; i++) {
LordGT 1:9867060b8cea 9 myservo = i/100.0;
LordGT 1:9867060b8cea 10 wait(0.01);
LordGT 1:9867060b8cea 11 }
LordGT 1:9867060b8cea 12 for(int i=100; i>0; i--) {
LordGT 1:9867060b8cea 13 myservo = i/100.0;
LordGT 1:9867060b8cea 14 wait(0.01);
LordGT 1:9867060b8cea 15 }
LordGT 1:9867060b8cea 16 }
LordGT 1:9867060b8cea 17 }