Example #1
0
        public void Run(MotorAction command)
        {
            if (MotorController == null)
            {
                return;
            }

            if (command == MotorAction.FORWARD)
            {
                MotorController.SetPin(MotorIn2Pin, 0);
                MotorController.SetPin(MotorIn1Pin, 1);
            }
            else if (command == MotorAction.BACKWARD)
            {
                MotorController.SetPin(MotorIn1Pin, 0);
                MotorController.SetPin(MotorIn2Pin, 1);
            }
            else if (command == MotorAction.RELEASE)
            {
                MotorController.SetPin(MotorIn1Pin, 0);
                MotorController.SetPin(MotorIn2Pin, 0);
            }
        }