Mako SHIMURA
/
LPC810_auto_LED_Blinky
小型化LEDピアス用
Diff: main.cpp
- Revision:
- 0:e0cbece9fd4f
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun Jul 13 15:50:54 2014 +0000 @@ -0,0 +1,34 @@ +#include "mbed.h" + +DigitalOut myledB(P0_0); //lpc810 dp8 +DigitalOut myledG(P0_1); //lpc810 dp5 + +int main(){ + while(1){ + + for( int i = 1,j=20;i<20; i++,j--){ + for(int k = 1;k<20;k++){ + myledB = 1; + myledG = 0; // LED No , Red , Green , Blue + wait_ms(i); + myledB = 0; + myledG = 1; + wait_ms(j); + } + } + + + for(int i = 20,j =0; i > 1 ; i--, j++){ + for(int k = 1;k<20;k++){ + myledB = 1; + myledG = 0; // LED No , Red , Green , Blue + wait_ms(i); + myledB = 0; + myledG = 1; + wait_ms(j); + } + } + + } +} +