servo2_pwm

Dependencies:   Servo mbed

Files at this revision

API Documentation at this revision

Comitter:
Mateo_97
Date:
Tue May 15 02:15:20 2018 +0000
Commit message:
Servo2_pwm

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	Tue May 15 02:15:20 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	Tue May 15 02:15:20 2018 +0000
@@ -0,0 +1,15 @@
+// Hello World to sweep a servo through its full range
+ 
+#include "mbed.h"
+#include "Servo.h"
+ 
+Servo myservo(PB_3);
+ 
+int main() {    
+while(1){
+    for(float p=0; p<1.0; p += 0.1) {
+        myservo = p;//P representa el porcentaje de movimiento. Si el servo se mueve 180° y p es 0.5; querra decir 50%; osea 90°
+        wait(0.2);
+    }
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue May 15 02:15:20 2018 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/5aab5a7997ee
\ No newline at end of file