예제 #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());
 }