小型化LEDピアス用

Dependencies:   mbed

main.cpp

Committer:
asagin
Date:
2014-07-13
Revision:
0:e0cbece9fd4f

File content as of revision 0:e0cbece9fd4f:

#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);
            }
        }

        }
}