春ロボ 2班 2017
/
asimawari
主にオムニです。
Fork of asimawari by
Diff: GET_position/photo.h
- Revision:
- 2:0a99389df632
- Parent:
- 0:1787ed4e6e61
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/GET_position/photo.h Wed Oct 25 08:54:30 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