private static void CarRunStatus(ID motorid, Dir direction, int speed)
        {
            if ((motorid == ID.LeftMotor) && (direction == Dir.Forward) && (speed != 0))
            {
                LeftDir = WDir.Forward;
            }
            if ((motorid == ID.LeftMotor) && (direction == Dir.Backward) && (speed != 0))
            {
                LeftDir = WDir.Backward;
            }
            if ((motorid == ID.LeftMotor) && (speed == 0))
            {
                LeftDir = WDir.Stop;
            }
            if ((motorid == ID.RightMotor) && (direction == Dir.Forward) && (speed != 0))
            {
                RightDir = WDir.Forward;
            }
            if ((motorid == ID.RightMotor) && (direction == Dir.Backward) && (speed != 0))
            {
                RightDir = WDir.Backward;
            }
            if ((motorid == ID.RightMotor) && (speed == 0))
            {
                RightDir = WDir.Stop;
            }

            if (LeftDir == RightDir)
            {
                CarRuntime(speed);
            }
        }
Example #2
0
 public void setWorkingDirectory(WDir dir, string path)
 {
     this.workingDir       = dir;
     this.workingDirectory = path;
 }