/// <summary>
 /// Sends a command to the Arduino Device.
 /// </summary>
 /// <param name="body"></param>
 /// <param name="responsePort"></param>
 public SendArduinoDeviceCommand(ArduinoDeviceCommand body, Microsoft.Ccr.Core.PortSet <Microsoft.Dss.ServiceModel.Dssp.DefaultUpdateResponseType, W3C.Soap.Fault> responsePort)
     : base(body, responsePort)
 {
 }
Ejemplo n.º 2
0
        /// <summary>
        /// for self-contained test, uncomment the call to this metod above and watch console
        /// </summary>
        /// <returns></returns>
        private IEnumerator <ITask> TestAnimatedHead()
        {
            while (!_state.Connected)
            {
                Console.WriteLine("TestAnimatedHead - waiting to connect...");
                yield return(Timeout(2000));
            }

            Console.WriteLine("TestAnimatedHead - ClearAnimations()");
            //ClearAnimations();

            ArduinoDeviceCommand cmd = new ArduinoDeviceCommand()
            {
                Command = AnimatedHeadCommands.ANIMATIONS_CLEAR
            };

            _animatedHeadCommandPort.Post(new SendArduinoDeviceCommand(cmd));

            yield return(Timeout(4000));

            Console.WriteLine("TestAnimatedHead - DefaultAnimations()");
            //DefaultAnimations();

            cmd = new ArduinoDeviceCommand()
            {
                Command = AnimatedHeadCommands.ANIMATIONS_DEFAULT
            };

            _animatedHeadCommandPort.Post(new SendArduinoDeviceCommand(cmd));

            yield return(Timeout(3000));

            Console.WriteLine("TestAnimatedHead - SetAnimCombo('Mad')");
            //SetAnimCombo("Mad", 0.2d, true);

            // Valid Combo names:
            //  Acknowledge, Afraid, Alert, Alert_lookleft, Alert_lookright, Angry, Blink, Blink1, BlinkCycle, Decline, Look_down, Look_up, Lookaround,
            //  Mad, Mad2, Notgood, Ohno, Pleased, Restpose, Sad,
            //  Smallturnleft, Smallturnleftdow, Smallturnrigh, Smallturnrightdow,
            //  Smile, Surprised, Think, Turn_left, Turn_left_smile, Turn_right, Turn_right_smile, Upset, What, Wow, Yeah, Yell, Talk

            cmd = new ArduinoDeviceCommand()
            {
                Command = AnimatedHeadCommands.SetAnimCombo, Args = "Mad", Scale = 0.2d, doRepeat = true
            };

            _animatedHeadCommandPort.Post(new SendArduinoDeviceCommand(cmd));

            yield return(Timeout(4000));

            cmd = new ArduinoDeviceCommand()
            {
                Command = AnimatedHeadCommands.SetAnimCombo, Args = "Acknowledge", Scale = 0.2d, doRepeat = true
            };

            _animatedHeadCommandPort.Post(new SendArduinoDeviceCommand(cmd));

            yield return(Timeout(4000));

            cmd = new ArduinoDeviceCommand()
            {
                Command = AnimatedHeadCommands.ANIMATIONS_CLEAR
            };

            _animatedHeadCommandPort.Post(new SendArduinoDeviceCommand(cmd));

            yield break;
        }
 /// <summary>
 /// Sends a command to the Arduino Device.
 /// </summary>
 /// <param name="body"></param>
 public SendArduinoDeviceCommand(ArduinoDeviceCommand body)
     : base(body)
 {
 }