OutputBit Method

void OutputBit(int port, int bit, int val)
void OutputBit(int port, int bit, bool val)

Summary

This overloaded method alters a single bit of the output value of any I/O port without affecting the value of any other bits. See the OutputByte Method for further description of the output value.

Parameters

  • port - The port number (0-5).

  • bit - The bit number (0-7).

  • val - Any nonzero number or true sets the bit to 1 and zero or false clears the bit to 0.

Return Value

This method does not return a value.

Remarks

This method alters the specified bit's value in a single operation directly on the ETH32 device. In other words, it does NOT read the current value over the network, modify it and then write it back. By doing it in a single operation, this avoids the potential of inadvertently overwriting changes made to other bits by other connections.

Port 3 shares its pins with the analog channels. When the ADC is enabled, all pins of port 3 are forced into input mode and the output value is set to zero. Port 3's output value cannot be modified while the ADC is enabled.

See Also

InputBit Method, OutputByte Method, SetDirectionBit Method