setToOutput(_:value:)

Sets the pin to output digital signal.

DigitalInOut.swift:190
@discardableResult func setToOutput(_ mode: DigitalOut.Mode? = nil, value: Bool? = nil) -> Result<(), Errno>

Parameters

mode

The output mode: .pushPull or .openDrain. If you don’t set it, it remains the same as the mode after initialization.

value

The output value: true or false. If you don’t set it, it remains the same as the value after initialization.

Returns

Whether the configuration succeeds. If it fails, it returns the specific error.