Edit

Share via


GpioPin.Write(PinValue) Method

Definition

Drives the specified value onto the general purpose I/O (GPIO) pin according to the current pin mode for the pin if the pin is configured as an output, or updates the latched output value for the pin if the pin is configured as an input.

public virtual void Write (System.Device.Gpio.PinValue value);
abstract member Write : System.Device.Gpio.PinValue -> unit
override this.Write : System.Device.Gpio.PinValue -> unit
Public Overridable Sub Write (value As PinValue)

Parameters

value
PinValue

The enumeration value to write to the GPIO pin.

If the GPIO pin is configured as an output, the method drives the specified value onto the pin according to the current pin mode for the pin.

If the GPIO pin is configured as an input, the method updates the latched output value for the pin. The latched output value is driven onto the pin when the configuration for the pin changes to output.

Exceptions

This exception will be thrown on an attempt to write to a pin that hasn't been opened or is not configured as output.

Applies to