マクドナルドのポテトが揚がった音を止められるよにしよう

Dependencies:   mbed

main.cpp

Committer:
kohacraft
Date:
2015-12-16
Revision:
0:c0b6adb7c5e8

File content as of revision 0:c0b6adb7c5e8:

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