omuni

Dependencies:   EC mbed

photo.h

Committer:
yuto17320508
Date:
2017-10-21
Revision:
0:1787ed4e6e61

File content as of revision 0:1787ed4e6e61:

//フォトインタラプタ上
InterruptIn photo_1();
//フォトインタラプタ下
InterruptIn photo_2();

//フラグ
int right_flag=1;
int left_flag=1;
//フォトトランジスタのフラグ呼び出し
void photo_1_rise()//右に平行移動しない
{
    right_flag=0;
}
void photo_1_fall()//右に平行移動する
{
    right_flag=1;
}
void photo_2_rise()//左に平行移動しない
{
    left_flag=0;
}
void photo_2_fall()//左に平行移動する
{
    left_flag=1;
}


//フォトインタラプタ1
    photo_1.rise(&photo_1_rise);
    photo_1.fall(&photo_1_fall);

//フォトインタラプタ2
    photo_2.rise(&photo_2_rise);
    photo_2.fall(&photo_2_fall);