Dependencies: mbed
Diff: main.cpp
- Revision:
- 4:076faa2578a4
- Parent:
- 2:40cfcd06ac8b
--- a/main.cpp Mon Jun 30 07:27:05 2014 +0000 +++ b/main.cpp Tue Jul 01 08:57:18 2014 +0000 @@ -19,7 +19,6 @@ void moveOmni(int ox,int oy) { - double trans[4] = {0}; trans[0] = ox*(cos(0.75*PI)) + oy*(sin(0.75*PI)); @@ -28,7 +27,6 @@ trans[3] = ox*(cos(0.25*PI)) + oy*(sin(0.25*PI)); for(int i=0;i<4;i++){ - if(trans[i]>0){ motor[i*2] = 1; motor[i*2+1] = 0; @@ -41,10 +39,7 @@ trans[i]=100;} pwm[i] = (trans[i]/100.0); } - - - pc.printf("motor:%f, motor:%f, motor:%f, motor:%f\n",trans[0],trans[1],trans[2],trans[3]); - + pc.printf("motor:%f, motor:%f, motor:%f, motor:%f\n",trans[0],trans[1],trans[2],trans[3]); } int main() @@ -65,10 +60,8 @@ case 0xD: ix = iy = 50; break; case 0xB: ix = iy = -100; break; case 0x7: ix = iy = -50; break; - } - - moveOmni(ix,iy); - + } + moveOmni(ix,iy); check = !check; }