private void myPinButton_Click(object sender, RoutedEventArgs e) { PinDetails pin = new PinDetails(); pin.pin_id = pin_id; pin.ShowDialog(); }
public void SetPinDetails(PinDetails pinDetails) { try { var pin = Pi.Gpio[pinDetails.PinNumber]; pin.PinMode = pinDetails.PinMode == System.Device.Gpio.PinMode.Input ? Unosquare.RaspberryIO.Abstractions.GpioPinDriveMode.Input : Unosquare.RaspberryIO.Abstractions.GpioPinDriveMode.Output; if (pinDetails.PinMode == System.Device.Gpio.PinMode.Output) { pin.Value = pinDetails.PinValue == 1; } } catch (Exception ex) { _logger.LogError(ex, "Failed to set pin details."); throw; } }
public ActionResult setPinDetails(PinDetails details) { _Logger.Log(LogLevel.Information, "SetPinDetails Start..."); _GarageRepo.SetPinDetails(details); return(Ok()); }