![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Analog input ke hisaaf se LED ka light intensity vary hotai shahne jaise
Dependencies: mbed
Diff: main.cpp
- Revision:
- 0:fb98ee6f1056
diff -r 000000000000 -r fb98ee6f1056 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Jun 29 05:56:28 2016 +0000 @@ -0,0 +1,15 @@ +#include "mbed.h" + +AnalogIn pot(PTB0); +PwmOut led(PTD1); + +float value; +int main() +{ + while(1) + { + value=pot.read(); + led=1-value; + wait(0.1); + } +}