FORARKADI

Dependencies:   mbed mypidror1 Motor Map

Revision:
6:13f47e31348d
Parent:
5:8ef69c6f3718
Child:
7:34118a0098e8
--- a/recive.cpp	Fri Mar 06 20:37:15 2020 +0000
+++ b/recive.cpp	Fri Mar 13 12:23:35 2020 +0000
@@ -217,22 +217,22 @@
     commandMotor();
     //pc.printf("matzeret1 is: %.4f, matzeret2 is:%.4f\n\r", thorttle1, thorttle2);
     //pc.printf("Subthorttle is: %.4f\n\r", subThorttle);
-    if (subThorttle<330) { //checking error
-        mythorttle = mtodagree.Calculate(thorttle1);
-        sumthorttle = sumthorttle + mythorttle;
-        counter++;
-        if (t.read()>0) {
-            errorcounter = 0;
-            t.stop();
-            t.reset();
-            }
-        if (counter == 10) {
-            mdagree = sumthorttle/10;
-            counter = 0;
-            sumthorttle = 0;
-            }
+     //checking error
+    mythorttle = mtodagree.Calculate(thorttle1);
+    sumthorttle = sumthorttle + mythorttle;
+    counter++;
+    if (t.read()>0) {
+        errorcounter = 0;
+        t.stop();
+        t.reset();
         }
-    if (subThorttle>330) {
+    if (counter == 10) {
+        mdagree = sumthorttle/10;
+        counter = 0;
+        sumthorttle = 0;
+        }
+        
+    /*if (subThorttle>330) {
             if (errorcounter == 0) {
                 t.start();
                 errorcounter = 1;
@@ -244,7 +244,7 @@
                 errorcounter = 1;
                 sendError();
                 }
-            }
+            }*/
 }
 int main() {
     pc.baud(9600);