Aldo Omar Marez Aquino / Mbed 2 deprecated P7E1

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
aldomarez
Date:
Mon Oct 29 18:31:11 2018 +0000
Commit message:
vfv

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	Mon Oct 29 18:31:11 2018 +0000
@@ -0,0 +1,21 @@
+/*Mediante  un  potenciómetro  se  varié  el  ancho  de  pulso  para  manejar  la velocidad  de  un  motor  de  CD
+*/
+#include "mbed.h"
+AnalogIn pot(A0);
+PwmOut  motor(D6);  
+/*
+//El  periodo  por  defecto  es  de  0.020s  y  el  ancho  de  pulso  0
+  led.period(4.0f);//  4  second  period
+  led.write(0.50f);//  50%  duty  cycle,  relative  to period
+  led  =  0.5f;  //  shorthand  for led.write()
+  led.pulsewidth(2); //  alternative  to led.write, set  duty  cycle  time  in  seconds 
+*/
+
+int main() {
+    while(1) {
+        float ancho = pot;
+        motor.write(ancho);
+        
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Oct 29 18:31:11 2018 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/a7c7b631e539
\ No newline at end of file