Isme LED ka ON/OFF state control karte h. Agar input 0 hoga to ON, agar 1 hoga to OFF

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
akashlal
Date:
Fri Jul 01 01:50:07 2016 +0000
Commit message:
Isme LED ka ON/OFF state control hotai input ke hisaaf se. Agar input one hoga to OFF, 0 hoga to ON

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 Jul 01 01:50:07 2016 +0000
@@ -0,0 +1,21 @@
+#include "mbed.h"
+
+Serial pc(USBTX,USBRX);
+char i;
+DigitalOut led(LED1);
+int main() {
+    while(1) {
+        if(pc.readable())
+        {
+        i=pc.getc();    
+        }
+        if(i=='0')
+        {
+            led=1;
+        }
+        if(i=='1')
+        {
+            led=0;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Jul 01 01:50:07 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/6c34061e7c34
\ No newline at end of file