re:pub
Dependents: 200_yotsuba_21 200_yotuba_21_uiChange
Revision 9:9b1381c4ad90, committed 2021-03-07
- Comitter:
- THtakahiro702286
- Date:
- Sun Mar 07 12:24:01 2021 +0000
- Parent:
- 8:e11be46f5480
- Commit message:
- victory!!!!
Changed in this revision
sensorGen.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r e11be46f5480 -r 9b1381c4ad90 sensorGen.cpp --- 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); }