Equator Strut Controller

Dependents:   EquatorStrutDigitalMonitor

Revision:
1:580fded7b5b2
Parent:
0:a6ade00ff41d
Child:
2:3976e3f43470
--- a/EquatorStrutController.cpp	Tue Jul 29 08:44:30 2014 +0000
+++ b/EquatorStrutController.cpp	Tue Jul 29 11:12:10 2014 +0000
@@ -113,7 +113,7 @@
         }
         else
         {
-            return (0.02 / ((double)FullWavePeriod / 1000000)) * direction;
+            return (0.04 / ((double)FullWavePeriod / 1000000)) * direction;
         }
     }
     else
@@ -132,11 +132,15 @@
         {
             direction = 1;
             position += (0.04 * direction);
+            FullWavePeriod = SinInterruptInterval.read_us();
+            SinInterruptInterval.reset();
         }
         else if (PinState == 2)
         {
             direction = -1;
             position += (0.04 * direction);
+            FullWavePeriod = SinInterruptInterval.read_us();
+            SinInterruptInterval.reset();
         }
     }
     else