コード例 #1
0
 /// <summary>
 /// Will be fired when photocoupler input 4 state is changed.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="args"></param>
 private void Photocoupler4_ValueChanged(GpioPin sender, GpioPinValueChangedEventArgs args)
 {
     if (args.Edge == GpioPinEdge.RisingEdge)
     {
         PhotocouplerInputEventArgs ea = new PhotocouplerInputEventArgs(4, true);
         OnPhotocouplerInputChange(ea);
     }
     else if (args.Edge == GpioPinEdge.FallingEdge)
     {
         PhotocouplerInputEventArgs ea = new PhotocouplerInputEventArgs(4, false);
         OnPhotocouplerInputChange(ea);
     }
 }