ioTinkers / Mbed 2 deprecated pwmm

Dependencies:   Servo mbed

Files at this revision

API Documentation at this revision

Comitter:
LordGT
Date:
Mon Aug 13 05:37:28 2018 +0000
Parent:
0:344c80db9f20
Commit message:
fsefwef

Changed in this revision

Servo.lib Show annotated file Show diff for this revision Revisions of this file
asd.cpp Show annotated file Show diff for this revision Revisions of this file
main.cpp Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Servo.lib	Mon Aug 13 05:37:28 2018 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/simon/code/Servo/#36b69a7ced07
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/asd.cpp	Mon Aug 13 05:37:28 2018 +0000
@@ -0,0 +1,17 @@
+#include "mbed.h"
+#include "Servo.h"
+ 
+ Servo myservo(p21);
+ 
+ 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);
+         }
+     }
+ }
\ No newline at end of file
--- a/main.cpp	Mon Aug 13 05:30:48 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-#include "mbed.h"
-
-PwmOut my(p5);
-
-int main() {
-    while(1) {
-        my.period(0.7f);
-        my.write(0.5f);
-        wait(1.0);
-        my.period(1.1f);
-        my.write(0.5f);
-        wait(1.0);
-        my.period(1.5f);
-        my.write(0.5f);
-        wait(1.0);
-        my.period(1.9f);
-        my.write(0.5f);
-        wait(1.0);
-        }
-        
-  }
\ No newline at end of file