![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Realize the Ledfow
Dependencies: mbed
Fork of DigitalOut_HelloWorld by
main.cpp
- Committer:
- shiyilei
- Date:
- 2014-10-14
- Revision:
- 3:743f42c80067
- Parent:
- 2:b4e2eee99a28
File content as of revision 3:743f42c80067:
/********************************* *file name:LED flow *creator: Jacob Shi *Time :2014/10/10 *illustration : make the led1~ *led3 flow ********************************/ #include "mbed.h" DigitalOut led1(LED1); DigitalOut led2(LED2); DigitalOut led3(LED3); int state=0; int main(void) { while(1) { switch(state) { case 0: led1=1;led2=0;led3=0;state++;break; case 1: led1=0;led2=1;led3=0;state++;break; case 2: led1=0;led2=0;led3=1;state++;break; default: break; } if(state==3) state=0; wait(0.3); } }