コード例 #1
0
        /// <summary>
        /// Called when gyroscope data has been acquired from the Myo.
        /// </summary>
        /// <param name="evt">The pointer to the event.</param>
        /// <param name="timestamp">The timestamp of the event.</param>
        protected virtual void OnAcquiredGyroscopeData(IntPtr evt, DateTime timestamp)
        {
            var gyroscope = _myoDeviceDriver.GetGyroscope(evt);

            this.Gyroscope = gyroscope;

            var handler = GyroscopeDataAcquired;

            if (handler != null)
            {
                var args = new GyroscopeDataEventArgs(
                    this,
                    timestamp,
                    gyroscope);
                handler.Invoke(this, args);
            }
        }
コード例 #2
0
ファイル: Myo.cs プロジェクト: Tineler/Myo-Car-Control
        /// <summary>
        /// Called when gyroscope data has been acquired from the Myo.
        /// </summary>
        /// <param name="evt">The pointer to the event.</param>
        /// <param name="timestamp">The timestamp of the event.</param>
        protected virtual void OnAcquiredGyroscopeData(IntPtr evt, DateTime timestamp)
        {
            // Contract.Requires<ArgumentException>(evt != IntPtr.Zero, "The event handle must be set.");

            var gyroscope = _myoDeviceDriver.GetGyroscope(evt);

            this.Gyroscope = gyroscope;

            var handler = GyroscopeDataAcquired;

            if (handler != null)
            {
                var args = new GyroscopeDataEventArgs(
                    this,
                    timestamp,
                    gyroscope);
                handler.Invoke(this, args);
            }
        }