re:pub

Dependents:   200_yotsuba_21 200_yotuba_21_uiChange

Revision:
9:9b1381c4ad90
Parent:
8:e11be46f5480
--- a/sensorGen.cpp	Sat Mar 06 07:27:00 2021 +0000
+++ b/sensorGen.cpp	Sun Mar 07 12:24:01 2021 +0000
@@ -128,14 +128,15 @@
         yellowRange = hypot(yellowx,yellowy); 
         for(int i=0; i < 6; i++) line[i] = _line[i]->judg();
         if(irVal >= 20) ballKeep = 1;
+        else ballKeep = 0;
+        
 //        ballKeep = 0;
-        if (ballKeep && (ballkeepcount < 200)) {
-            ballkeepcount++;
+        if (ballKeep) {
+            ballkeepcount = 50;
         } else if(ballkeepcount > 0) {
             ballkeepcount--;
         }
         irVal = ir.getDistance();
-        else ballKeep = 0;
         ThisThread::sleep_for(1000/300);
     }