Example #1
0
        // OnPose() is called whenever the Myo detects that the person wearing it has changed their pose, for example,
        // making a fist, or not making a fist anymore.
        static void OnPoseChanged(object sender, PoseChangedEventArgs e)
        {
            currentPose = e.Pose;

            // Vibrate the Myo whenever we've detected that the user has made a fist.
            if (e.Pose == Pose.Fist)
                e.Myo.Vibrate(VibrationType.Medium);
        }
Example #2
0
        static void OnPoseChanged(object sender, PoseChangedEventArgs e)
        {
            Pose oldPose = currentPose;

            currentPose = e.Pose;

            // Vibrate the Myo whenever we've detected that the user has made a fist.
            switch (e.Pose)
            {
            case Pose.Fist:
                motorController.moveForward();
                break;

            case Pose.WaveIn:
                motorController.turnLeft();
                break;

            case Pose.WaveOut:
                motorController.turnRight();
                break;

            case Pose.ThumbToPinky:
                motorController.reverse();
                break;

            case Pose.FingersSpread:
                motorController.stop();
                break;

            default:
                motorController.stop();
                break;
            }
            if (currentPose != oldPose)
            {
                e.Myo.Vibrate(VibrationType.Short);
            }
        }
Example #3
0
        // OnPose() is called whenever the Myo detects that the person wearing it has changed their pose, for example,
        // making a fist, or not making a fist anymore.
        protected void OnPoseChanged(object sender, PoseChangedEventArgs e)
        {
            lock (myLock)
            {
                if (currentPose == Pose.Fist || currentPose == Pose.FingersSpread)
                {
                    e.Myo.Vibrate(VibrationType.Short);
                }

                currentPose = e.Pose;

                if (e.Pose == Pose.Fist || e.Pose == Pose.FingersSpread)
                {
                    referenceOrientation = currentOrientation;
                    e.Myo.Vibrate(VibrationType.Short);
                }
                else if (e.Pose == Pose.DoubleTap)
                {
                    e.Myo.Vibrate(VibrationType.Medium);
                    takeoffLand = true;
                }
            }
        }
Example #4
0
		// OnPose() is called whenever the Myo detects that the person wearing it has changed their pose, for example,
		// making a fist, or not making a fist anymore.
		static void OnPoseChanged(object sender, PoseChangedEventArgs e)
		{
			currentPose = e.Pose;

			// Vibrate the Myo whenever we've detected that the user has made a fist.
			if (e.Pose == Pose.Fist)
				e.Myo.Vibrate(VibrationType.Medium);
		}
Example #5
0
        // OnPose() is called whenever the Myo detects that the person wearing it has changed their pose, for example,
        // making a fist, or not making a fist anymore.
        protected void OnPoseChanged(object sender, PoseChangedEventArgs e)
        {
            lock (myLock)
            {
                if (currentPose == Pose.Fist || currentPose == Pose.FingersSpread)
                {
                    e.Myo.Vibrate(VibrationType.Short);
                }

                currentPose = e.Pose;

                if (e.Pose == Pose.Fist || e.Pose == Pose.FingersSpread)
                {
                    referenceOrientation = currentOrientation;
                    e.Myo.Vibrate(VibrationType.Short);
                }
                else if (e.Pose == Pose.DoubleTap)
                {
                    e.Myo.Vibrate(VibrationType.Medium);
                    takeoffLand = true;
                }
            }
        }
Example #6
0
 void OnPoseChanged(object sender, PoseChangedEventArgs e)
 {
     _myoState.Pose = e.Pose;
 }
Example #7
0
 static void _myo_Notifications_PoseChanged(object sender, PoseChangedEventArgs e)
 {
     Print($"{e.NewPose}");
 }