private async void HandleMotionEvent(object sender, MotionEvents args) { if (args == MotionEvents.MotionDetected) { Debug.WriteLine("Motion detected"); await CaptureAndSendImageForAnalysis(); } else { Debug.WriteLine("No motion detected"); } }
private void _sensorDataPin_ValueChanged(GpioPin sender, GpioPinValueChangedEventArgs args) { if (args.Edge == GpioPinEdge.RisingEdge) { System.Diagnostics.Debug.WriteLine("MOTION DETECTED"); _motionEvents = MotionEvents.MotionDetected; } else { System.Diagnostics.Debug.WriteLine("NO MOTION DETECTED"); _motionEvents = MotionEvents.NoMotionDetected; } MotionEventHandler?.Invoke(this, _motionEvents); }
private void HandleMotionEvent(object sender, MotionEvents args) { MotionEventHandler?.Invoke(sender, args); }