> For the complete documentation index, see [llms.txt](https://mwx.twelite.info/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mwx.twelite.info/latest_en/api-reference/funcs/dio/pinmode.md).

# pinMode()

Sets the DIO (general-purpose digital IO) pin.

```cpp
void pinMode(uint8_t u8pin, E_PIN_MODE mode)
```

This function allows you to change the state of DIO0..19 and the pins DO0,1. The setting contents are described in the enumeration value of `E_PIN_MODE`, [description of DIO](broken://pages/-LwHw2ptOl3clGFYr-uD) and [Description of DO](broken://pages/-LwHw2ptOl3clGFYr-uD).

{% hint style="danger" %}
DO0,1 are special pins, which in principle are used for other purposes, but can also be configured as outputs. However, these pins have hardware restrictions, so care must be taken when using them.

Both pins must be guaranteed to be at a HIGH level when power is applied. If the circuit is configured to take unstable voltages, the module will not start up.
{% endhint %}
