pwm led

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
kaushalpkk
Date:
Thu Jul 12 17:30:07 2018 +0000
Commit message:
commit

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
diff -r 000000000000 -r 3946b8f2e75f main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Jul 12 17:30:07 2018 +0000
@@ -0,0 +1,22 @@
+#include "mbed.h"
+
+PwmOut led1(LED1);
+PwmOut led2(LED4);
+
+int count =0;
+
+int main(){
+    printf("Hello world\n");
+    while(1) {
+        for(float i=0; i<100; i++){
+            led1 = i/100;
+            led2 = (100-i)/100;
+            wait(0.02);
+        } 
+        for(float i=0; i<100; i++){
+            led2 = i/100;
+            led1 = (100-i)/100;
+            wait(0.02);
+        } 
+    }
+}
diff -r 000000000000 -r 3946b8f2e75f mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Jul 12 17:30:07 2018 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/a7c7b631e539
\ No newline at end of file