예제 #1
0
        private void _mpu6050_SensorInterruptEvent(object sender, MpuSensorEventArgs e)
        {
            var task = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                _interruptCount       += e.Values.Length;
                float samplesPerSecond = (float)_interruptCount / (float)((DateTime.Now - _startTime).Seconds);

                textBoxStatus.Text = String.Format("{0} {1} {2}", e.Status, e.SamplePeriod, samplesPerSecond);
                textBoxAccel.Text  = String.Format("{0}, {1}, {2}", e.Values[0].AccelerationX, e.Values[0].AccelerationY,
                                                   e.Values[0].AccelerationZ);
                textBoxGyro.Text = String.Format("{0}, {1}, {2}", e.Values[0].GyroX, e.Values[0].GyroY,
                                                 e.Values[0].GyroZ);
            });
        }
예제 #2
0
        void MpuSensorInterruptEvent(object sender, MpuSensorEventArgs e)
        {
            sensorData = e.Values[0];

            Debug.WriteLine(e.ToString());
        }