# digitalWrite()

ディジタル出力ピンの設定を変更します。

```cpp
static inline void digitalWrite(uint8_t u8pin, E_PIN_STATE ulVal)
```

事前に`pinMode()`にて設定対象のピンを出力用に設定しておきます。１番目のパラメータは、設定対象のピン番号を指定します。２番目のパラメータは`HIGH`か`LOW`のいずれかを指定します。

{% hint style="info" %}
入力が `E_PIN_STATE` 型となっています。`E_PIN_STATE`から`int`型への変換演算子は定義していませんので、数値による直接の入力はできないようになっています。
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mwx.twelite.info/v0.1.7/api-reference/functions-1/dio/digitalwrite.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
