Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Revision 4:076faa2578a4, committed 2014-07-01
- Comitter:
- Hatter
- Date:
- Tue Jul 01 08:57:18 2014 +0000
- Parent:
- 2:40cfcd06ac8b
- Commit message:
- pin????PWM????????????????
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 40cfcd06ac8b -r 076faa2578a4 main.cpp
--- 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;
}