Sarahi Moran / Mbed 2 deprecated PWM_Part_tarea1

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
Sarahi
Date:
Thu Aug 28 21:39:23 2014 +0000
Commit message:
:)

Changed in this revision

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/main.cpp	Thu Aug 28 21:39:23 2014 +0000
@@ -0,0 +1,21 @@
+#include "mbed.h"
+
+PwmOut PWM1(D5);
+
+void mover_servo (int tem);
+
+int main()
+{    
+  PWM1.period_ms(20);     //Periodo de 10 ms
+
+    while (true){
+        int t = 10;
+        mover_servo(t);        
+    }
+}
+
+
+void mover_servo(int tem){
+    int pulso = tem *  25 + 1000;
+    PWM1.pulsewidth_us(pulso);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Aug 28 21:39:23 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/9327015d4013
\ No newline at end of file