![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
öpl
Dependencies: mbed
Diff: main.cpp
- Revision:
- 0:b868dbbf6c88
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Sep 28 13:43:07 2015 +0000 @@ -0,0 +1,38 @@ +#include "mbed.h" + +BusOut myled(LED4,LED3,LED2,LED1); + +float delay=0.2; + +int main() +{ + while(1) + { + + for(int i=0;i<=8;i=i*2) + { + if(i==0) + { + myled=0; + wait(delay); + i=i+1; + } + myled=i; + wait(delay); + + + } + for(int i=8;i>=1;i=i/2) + { + if(i==8) + { + myled=0; + wait(delay); + } + myled=i; + wait(delay); + + } + + } +} \ No newline at end of file