Kiko Ishimoto
/
robocon2017_Slave_ver2
ロボットに積む
Revision 1:4fb26a2daf03, committed 2017-10-21
- Comitter:
- kikoaac
- Date:
- Sat Oct 21 04:56:12 2017 +0000
- Parent:
- 0:06f2d82c048c
- Commit message:
- ???;
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 06f2d82c048c -r 4fb26a2daf03 main.cpp --- a/main.cpp Fri Oct 13 22:48:12 2017 +0000 +++ b/main.cpp Sat Oct 21 04:56:12 2017 +0000 @@ -19,7 +19,6 @@ for(int i = 1;i < 24;i++){ RXDATA[i] = master.getc(); } - for(int i = 0 ; i < 4 ; i++)run(i); } } void waitTime(float ti){ @@ -29,14 +28,13 @@ t.stop(); return; } -#if 1//R +#if 0//R #define head 4 void run(int i){ //for(int i = 0 ; i < 4 ; i ++ ){ for(int j = 0 ; j < 2; j++){ - data[i][0].c[j] = RXDATA[head + i*2 + j]; - - } + data[i][0].c[j] = RXDATA[head + i*2 + j]; + } arm[i] = (float)data[i][0].sd/0xffff; //printf("%d %f ",i,float(data[i].sd)/0xffff); //} @@ -48,7 +46,7 @@ //for(int i = 0 ; i < 4 ; i ++ ){ for(int j = 0 ; j < 2; j++){ data[i][0].c[j] = RXDATA[head + i*2 + j]; - } + } arm[i] = (float)data[i][0].sd/0xffff; //printf("%d %f %d %d ",i,float(data[i].sd)/0xffff , data[i].c[1] , data[i].c[0]); //} @@ -90,6 +88,7 @@ } waitTime(0.01); */ - wait(0.001); + for(int i = 0 ; i < 4 ; i++)run(i); + waitTime(20.0/1000.0); } } \ No newline at end of file