private void Run() { _peach = new Peach(); _peach.Button.ButtonPressed += Button_ButtonPressed; _accelerometer = (new SensorBoard()).Accelerometer; _accelerometer.MeasurementRange = Accelerometer.Range.FourG; _accelerometer.MeasurementComplete += _accelerometer_MeasurementComplete; _accelerometer.Interval = 1000; _testTimer = new Timer(PollingMeasure, null, new TimeSpan(0, 0, 1), new TimeSpan(0, 0, 1)); while (true) { } }
private void _accelerometer_MeasurementComplete(Accelerometer sender, Accelerometer.MeasurementCompleteEventArgs e) { Debug.Print("Event : x = " + e.X.ToString() + ", y = " + e.Y.ToString() + ", z = " + e.Z.ToString()); }