private void Run() { _peach = new Peach(); _peach.Button.ButtonPressed += Button_ButtonPressed; _sensor = new AnalogSensor(Cpu.AnalogChannel.ANALOG_0); _sensor.MeasurementComplete += _sensor_MeasurementComplete; _sensor.Interval = 1000; _testTimer = new Timer(PollingMeasure, null, new TimeSpan(0, 0, 1), new TimeSpan(0, 0, 1)); while (true) { } }
private void _sensor_MeasurementComplete(AnalogSensor sender, AnalogSensor.MeasurementCompleteEventArgs e) { Debug.Print("Event : " + e.RawValue.ToString() + ", " + e.Value.ToString()); }