Alejandro Forero / Mbed 2 deprecated InOutPwm

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
alejandroforero
Date:
Thu Dec 10 16:48:13 2015 +0000
Commit message:
PWM output controlled with a analog input signal

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 Dec 10 16:48:13 2015 +0000
@@ -0,0 +1,22 @@
+#include "mbed.h"
+
+/*connect the pin number 1 of the potentiometer in the pin 12-J3 (5V-USB) of the board FRDM-K64F,
+ the middle pin of potentiometer in the pin 2-J4(PTB-2 or A0) and the last pin connected to ground,
+  pin 12-J3 or 14-j3. connect a LED to the pins of signal "with resistor"(8-J1 or PTA1 or D3 are equal)and ground (pin 14-J2) */
+
+
+
+AnalogIn Pot(A0);
+PwmOut Led(D3);
+float valor;
+
+int main(){
+    
+    
+    while (true) {        
+    valor=Pot.read();
+    Led.write(valor);
+    wait(0.02);      
+      
+      } 
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Dec 10 16:48:13 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/9296ab0bfc11
\ No newline at end of file