public void ClearHeadAnimations()
        {
            Console.WriteLine("ClearHeadAnimations");

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

            _animatedHeadCommandPort.Post(new animhead.SendArduinoDeviceCommand(cmd));
        }
Esempio n. 2
0
        public void StartHeadAnimationsDefault()
        {
            Console.WriteLine("StartHeadAnimationsDefault");

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

            _animatedHeadCommandPort.Post(new animhead.SendArduinoDeviceCommand(cmd));
        }
Esempio n. 3
0
        public void ClearHeadAnimations()
        {
            Console.WriteLine("ClearHeadAnimations");

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

            _animatedHeadCommandPort.Post(new animhead.SendArduinoDeviceCommand(cmd));
        }
Esempio n. 4
0
        private void StartHeadAnimationComboNow(HeadComboAnimations anim, bool add, bool repeat, double scale)
        {
            string animName = (add ? "+" : string.Empty) + anim.ToString();

            animhead.ArduinoDeviceCommand cmd = new animhead.ArduinoDeviceCommand()
            {
                Command = animhead.AnimatedHeadCommands.SetAnimCombo, Args = animName, Scale = scale, doRepeat = repeat
            };

            _animatedHeadCommandPort.Post(new animhead.SendArduinoDeviceCommand(cmd));

            lastHeadAnimationComboStarted = DateTime.Now;
            lastHeadAnimationCombo        = anim;
            lastHeadAnimationComboRepeat  = repeat;
        }
        private void StartHeadAnimationComboNow(HeadComboAnimations anim, bool add, bool repeat, double scale)
        {
            string animName = (add ? "+" : string.Empty) + anim.ToString();

            animhead.ArduinoDeviceCommand cmd = new animhead.ArduinoDeviceCommand() { Command = animhead.AnimatedHeadCommands.SetAnimCombo, Args = animName, Scale = scale, doRepeat = repeat };

            _animatedHeadCommandPort.Post(new animhead.SendArduinoDeviceCommand(cmd));

            lastHeadAnimationComboStarted = DateTime.Now;
            lastHeadAnimationCombo = anim;
            lastHeadAnimationComboRepeat = repeat;
        }
        public void StartHeadAnimationsDefault()
        {
            Console.WriteLine("StartHeadAnimationsDefault");

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

            _animatedHeadCommandPort.Post(new animhead.SendArduinoDeviceCommand(cmd));
        }
        /// <summary>
        /// for a test, uncomment the call to this metod above and watch console
        /// </summary>
        /// <returns></returns>
        private IEnumerator<ITask> TestAnimatedHead()
        {
            Console.WriteLine("AnimatedHeadTestService:TestAnimatedHead - started");

            yield return Timeout(8000);

            Console.WriteLine("AnimatedHeadTestService:TestAnimatedHead - ClearAnimations");

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

            _animatedHeadCommandPort.Post(new animatedheadservice.SendArduinoDeviceCommand(cmd));

            yield return Timeout(4000);

            Console.WriteLine("AnimatedHeadTestService:TestAnimatedHead - DefaultAnimations");

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

            _animatedHeadCommandPort.Post(new animatedheadservice.SendArduinoDeviceCommand(cmd));

            yield return Timeout(3000);

            Console.WriteLine("AnimatedHeadTestService:TestAnimatedHead - SetAnimCombo('Mad')");

            // 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 animatedheadservice.ArduinoDeviceCommand() { Command = animatedheadservice.AnimatedHeadCommands.SetAnimCombo, Args = "Mad", Scale = 0.2d, doRepeat = true };

            _animatedHeadCommandPort.Post(new animatedheadservice.SendArduinoDeviceCommand(cmd));

            yield return Timeout(4000);

            Console.WriteLine("AnimatedHeadTestService:TestAnimatedHead - SetAnimCombo('Acknowledge')");

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

            _animatedHeadCommandPort.Post(new animatedheadservice.SendArduinoDeviceCommand(cmd));

            yield return Timeout(4000);

            Console.WriteLine("AnimatedHeadTestService:TestAnimatedHead - ClearAnimations");

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

            _animatedHeadCommandPort.Post(new animatedheadservice.SendArduinoDeviceCommand(cmd));

            yield break;
        }
Esempio n. 8
0
        /// <summary>
        /// for a test, uncomment the call to this metod above and watch console
        /// </summary>
        /// <returns></returns>
        private IEnumerator <ITask> TestAnimatedHead()
        {
            Console.WriteLine("AnimatedHeadTestService:TestAnimatedHead - started");

            yield return(Timeout(8000));

            Console.WriteLine("AnimatedHeadTestService:TestAnimatedHead - ClearAnimations");

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

            _animatedHeadCommandPort.Post(new animatedheadservice.SendArduinoDeviceCommand(cmd));

            yield return(Timeout(4000));

            Console.WriteLine("AnimatedHeadTestService:TestAnimatedHead - DefaultAnimations");

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

            _animatedHeadCommandPort.Post(new animatedheadservice.SendArduinoDeviceCommand(cmd));

            yield return(Timeout(3000));

            Console.WriteLine("AnimatedHeadTestService:TestAnimatedHead - SetAnimCombo('Mad')");

            // 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 animatedheadservice.ArduinoDeviceCommand()
            {
                Command = animatedheadservice.AnimatedHeadCommands.SetAnimCombo, Args = "Mad", Scale = 0.2d, doRepeat = true
            };

            _animatedHeadCommandPort.Post(new animatedheadservice.SendArduinoDeviceCommand(cmd));

            yield return(Timeout(4000));

            Console.WriteLine("AnimatedHeadTestService:TestAnimatedHead - SetAnimCombo('Acknowledge')");

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

            _animatedHeadCommandPort.Post(new animatedheadservice.SendArduinoDeviceCommand(cmd));

            yield return(Timeout(4000));

            Console.WriteLine("AnimatedHeadTestService:TestAnimatedHead - ClearAnimations");

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

            _animatedHeadCommandPort.Post(new animatedheadservice.SendArduinoDeviceCommand(cmd));

            yield break;
        }