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.
Fork of 2015robot_main by
Diff: Swing.h
- Revision:
- 101:b67d33e56b66
- Parent:
- 100:5769dc0e7478
- Child:
- 112:717acc7c99f9
diff -r 5769dc0e7478 -r b67d33e56b66 Swing.h
--- a/Swing.h	Fri Oct 16 10:58:18 2015 +0000
+++ b/Swing.h	Sat Oct 17 06:04:49 2015 +0000
@@ -2,12 +2,12 @@
 #define SWING_H
 
 /***Swing.***/
-PID contSwing(10.917 ,10.0 ,0.0 ,RATE);
+PID contSwing(20.917 ,2.0 ,0.0 ,RATE);
 Ticker interruptSwingSpeed;
 
 inline void countSwingSpeed() {
     static int i = 0;
-    if (i < swingspeed) {
+    if (i <= swingspeed) {
         i+=swingspeed/10.0;
         targSwingRadVelocity=i;
     }
@@ -32,7 +32,7 @@
         enableShoot=0;
 //        waitTime = (float)(((2.0 * PI) / swingRadVelocity) / 2.0);
 //        waitTime = (float)((((10.0 * PI) / 4.0) / swingRadVelocity) / 8.0);
-        if(swingRadVelocity==0.0) waitTime = (float)((((2.0 * PI) / swingRadVelocity) / 4.0)-0.0017);
+        if(swingRadVelocity==0.0) waitTime = (float)((((2.0 * PI) / swingRadVelocity) / 4.0));//-0.0017);
         else waitTime=0.0;
         if(waitTime<0.0) waitTime=0.0;
         if(waitTime>10.0) waitTime=10.0;
    
