示例#1
0
        private void myPinButton_Click(object sender, RoutedEventArgs e)
        {
            PinDetails pin = new PinDetails();

            pin.pin_id = pin_id;
            pin.ShowDialog();
        }
示例#2
0
 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;
     }
 }
示例#3
0
 public ActionResult setPinDetails(PinDetails details)
 {
     _Logger.Log(LogLevel.Information, "SetPinDetails Start...");
     _GarageRepo.SetPinDetails(details);
     return(Ok());
 }