yuto kawamura
/
asimawari
omuni
Diff: photo.h
- Revision:
- 0:1787ed4e6e61
diff -r 000000000000 -r 1787ed4e6e61 photo.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/photo.h Sat Oct 21 07:57:16 2017 +0000 @@ -0,0 +1,34 @@ +//フォトインタラプタ上 +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); \ No newline at end of file