kohacraft Lab
/
kc_sample_mbed_sp2
マクドナルドのポテトが揚がった音を止められるよにしよう
Revision 0:c0b6adb7c5e8, committed 2015-12-16
- Comitter:
- kohacraft
- Date:
- Wed Dec 16 00:35:27 2015 +0000
- Commit message:
- ver1.0
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r c0b6adb7c5e8 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Dec 16 00:35:27 2015 +0000 @@ -0,0 +1,35 @@ +#include "mbed.h" + +DigitalOut myled(LED1); +DigitalIn sw(dp15); + +int main() { + while(1) { + for( int i = 0 ; i<200 ; i++ ) + { + myled = 1; + wait( 1.0 /784.0 /2.0 ); + myled = 0; + wait( 1.0 /784.0 /2.0 ); + } + for( int i = 0 ; i<180 ; i++ ) + { + myled = 1; + wait( 1.0 /698.5 /2.0 ); + myled = 0; + wait( 1.0 /698.5 /2.0 ); + } + for( int i = 0 ; i<200 ; i++ ) + { + myled = 1; + wait( 1.0 /784.0 /2.0 ); + myled = 0; + wait( 1.0 /784.0 /2.0 ); + } + wait(0.2); + if( sw == 1 ) + { + wait( 5 ); + } + } +}
diff -r 000000000000 -r c0b6adb7c5e8 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed Dec 16 00:35:27 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/4336505e4b1c \ No newline at end of file