# d_bit_out()

Sets the state of a single digital output bit.

This function treats all of the DIO ports of a particular type on a board as a single large port. It lets you set the state of any individual bit within this large port.

Most configurable ports require configuration before writing. Check board-specific information to determine if the port should be configured for your hardware. When configurable, use d_config_port() to configure a port for output, and d_config_bit() to configure a bit for output.

## Prototype

d_bit_out(board_num, port_type, bit_num, bit_value)

## Parameters

board_num (int)

The number associated with the board when it was installed with InstaCal or created with create_daq_device().

port_type (DigitalPortType)

There are three general types of digital ports – ports that are programmable as input or output, ports that are fixed input or output, and ports for which each bit may be programmed as input or output. For the first of these types, set PortType to DigitalPortType.FIRSTPORTA. For the latter two types, set PortType to DigitalPortType.AUXPORT. For devices with both types of digital ports, set PortType to either DigitalPortType.FIRSTPORTA or DigitalPortType.AUXPORT, depending on which digital inputs you wish to read.

bit_num (int)

Specifies the bit number within the single large port.

bit_value (int)

The value to set the bit to. Value will be 0 (logic low) or 1 (logic high). Logic high does not necessarily mean 5 V – refer to the device hardware user guide for chip input specifications.