예제 #1
0
        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);
            }
        }
예제 #2
0
파일: Project.cs 프로젝트: mfvanek/i-clone
 public void setWorkingDirectory(WDir dir, string path)
 {
     this.workingDir       = dir;
     this.workingDirectory = path;
 }