servomotor con PWM, sin librerias servo with PWM, without libraries

Dependencies:   Servo mbed

Files at this revision

API Documentation at this revision

Comitter:
Mateo_97
Date:
Sun May 20 19:39:42 2018 +0000
Commit message:
servomotor con PWM. sin librerias

Changed in this revision

Servo.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Servo.lib	Sun May 20 19:39:42 2018 +0000
@@ -0,0 +1,1 @@
+http://os.mbed.com/users/simon/code/Servo/#36b69a7ced07
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sun May 20 19:39:42 2018 +0000
@@ -0,0 +1,30 @@
+ // Continuously sweep the servo through it's full range
+ #include "mbed.h"
+ #include "Servo.h"
+ 
+ Servo myservo(PB_3);
+ 
+ int main() {
+     while(1) {
+         myservo.write(0.5);
+         wait(1);
+         myservo.write(1);
+         wait(1);
+         myservo.write(1.5);
+         wait(1);
+         myservo.write(2);
+         wait(1);
+         /*for(int i=0; i<200; i++) {
+             myservo = i/100.0;
+             wait(0.01);
+         }
+         for(int i=200; 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sun May 20 19:39:42 2018 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/5aab5a7997ee
\ No newline at end of file