![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Isme LED ka ON/OFF state control karte h. Agar input 0 hoga to ON, agar 1 hoga to OFF
Dependencies: mbed
Diff: main.cpp
- Revision:
- 0:bafd79bea892
--- /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; + } + } +}