GpioPin.ValueChanged 事件

定义

当常规用途 I/O (GPIO) 引脚的值发生更改时发生,可能是由于引脚配置为输入时存在外部刺激,或者在将引脚配置为输出时将值写入引脚。

// Register
event_token ValueChanged(TypedEventHandler<GpioPin, GpioPinValueChangedEventArgs const&> const& handler) const;

// Revoke with event_token
void ValueChanged(event_token const* cookie) const;

// Revoke with event_revoker
GpioPin::ValueChanged_revoker ValueChanged(auto_revoke_t, TypedEventHandler<GpioPin, GpioPinValueChangedEventArgs const&> const& handler) const;
public event TypedEventHandler<GpioPin,GpioPinValueChangedEventArgs> ValueChanged;
function onValueChanged(eventArgs) { /* Your code */ }
gpioPin.addEventListener("valuechanged", onValueChanged);
gpioPin.removeEventListener("valuechanged", onValueChanged);
- or -
gpioPin.onvaluechanged = onValueChanged;
Public Custom Event ValueChanged As TypedEventHandler(Of GpioPin, GpioPinValueChangedEventArgs) 

事件类型

Windows 要求

应用功能
lowLevel

适用于

另请参阅