Alejandro Forero / Mbed 2 deprecated Pwmlatente

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
alejandroforero
Date:
Thu Dec 10 15:47:50 2015 +0000
Commit message:
increment and decrement of PWM in an output

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 15:47:50 2015 +0000
@@ -0,0 +1,25 @@
+#include "mbed.h"
+/* view a PWM in an output with increment and decrement. anode led connected to PWM pin (8-J1 or PTA1 or D3 are equal) and cathode to ground (pin 14-J2)
+with 330ohms resistor. */
+
+PwmOut led (D3);
+float value =0;
+
+int main(){
+    
+    while (true) {
+       
+       for(value=0.0;value<=1.0;value+=0.02){
+           led.write(value);
+           wait(0.02);
+           }
+           
+       for(value=1.0;value>=0.0;value-=0.02){
+           led = value;
+           wait(0.02);
+           }    
+       
+       
+       
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Dec 10 15:47:50 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/9296ab0bfc11
\ No newline at end of file