Salida de PWM para un movimiento en ascendente y descendente de un servomotor

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
emanueltorres
Date:
Fri Feb 07 23:48:15 2020 +0000
Commit message:
PWM con sensor MG90S

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	Fri Feb 07 23:48:15 2020 +0000
@@ -0,0 +1,26 @@
+#include "mbed.h"
+
+PwmOut PWM1(PA_0);
+float i;
+int main()
+{
+    PWM1.period(0.010);
+    while(1)  {
+
+        for (i=0; i<1; i=i+0.1) {
+
+            PWM1=i;
+            wait(0.1);
+        }
+
+        for (i=1; i>0; i=i-0.1) {
+
+            PWM1=i;
+            wait(0.1);
+
+        }
+
+
+
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Feb 07 23:48:15 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file