![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
a
Diff: main.cpp
- Revision:
- 19:340fc4370258
- Parent:
- 18:d6be6154f9aa
- Child:
- 20:3f68738c4019
--- a/main.cpp Thu Sep 26 09:56:47 2019 +0000 +++ b/main.cpp Wed Oct 09 09:00:01 2019 +0000 @@ -58,6 +58,8 @@ // 足回り int lx,ly,rx; +int rod_hit=0; + /*----------------------------------- main -----------------------------------*/ int main() { @@ -105,7 +107,7 @@ else PALETTE(BLUE); //リミット - for(int i=0; i<7; i++) i2c.In(In_Data,i); + for(int i=0; i<9; i++) i2c.In(In_Data,i); lx = ((64-sbdbt.LY)*100.0/64)*sin(yaw*M_PI/180)+((sbdbt.LX-64)*100.0/64)*cos(yaw*M_PI/180); ly = ((64-sbdbt.LY)*100.0/64)*cos(yaw*M_PI/180)-((sbdbt.LX-64)*100.0/64)*sin(yaw*M_PI/180); @@ -543,9 +545,6 @@ } /* --------------電磁弁系-------------------- */ - /*タオル掛け*/ - if(sbdbt.L2)i2c.Out_Set(Out_Data,2,1); - else i2c.Out_Set(Out_Data,2,0); /*タオルを引っ張るやつ*/ if(sbdbt.R2)i2c.Out_Set(Out_Data,4,1); @@ -561,6 +560,12 @@ i2c.Out_Set(Out_Data,5,1); } else i2c.Out_Set(Out_Data,5,0); + if(!rod_hit) PALETTE(CYAN); + + /*タオル掛け*/ + if(sbdbt.L2) i2c.Out_Set(Out_Data,2,1); + else i2c.Out_Set(Out_Data,2,0); + //-------------- 出力 --------------// //第二引数には使う最大の個数 i2c.Out(Out_Data,9); @@ -576,6 +581,8 @@ short_lim = (In_Data+6)->in_data; slide_start = (In_Data+3)->in_data; slide_stop = (In_Data+0)->in_data; + rod_hit = (In_Data+8)->in_data; + /* ----------------ボタン系--------------- */ //角度リセット @@ -645,8 +652,8 @@ // pc.printf("yaw:%.1f %.1f",yaw, bno.euler.yaw); // pc.printf("%d %d",keep_tim[0].read_ms(),keep_f[0]); // pc.printf("LX:%d, LY:%d, RX:%d, RY:%d",sbdbt.LX, sbdbt.LY, sbdbt.RX, sbdbt.RY); -//for(int i=0; i<7; i++) - pc.printf("%d %d ",grab, grab_f); + for(int i=0; i<9; i++) + pc.printf("%d ",(In_Data+i)->in_data); pc.printf("\n\r"); } // while(1) } // int main()