此代码可检测库存中波动最大的日期:
double leftDist = distanceSensorLeft.getDistance(DistanceUnit.MM);
double rightDist = distanceSensorRight.getDistance(DistanceUnit.MM);
leftDrive.setTargetPosition(leftDrive.getCurrentPosition() - 1500);
rightDrive.setTargetPosition(rightDrive.getCurrentPosition() + 1500);
leftDrive.setPower(0.2);
rightDrive.setPower(-0.2);
while (leftDrive.isBusy() && rightDrive.isBusy() && opModeIsActive() && rightDist/* value is smaller than previous value*/ && leftDist// value is smaller than previous value ) {
}
我还要在最终循环输出中打印日期。该循环仅对匹配条件进行分类,但是我无法找到日期索引列。
谢谢