Files

23 lines
465 B
Markdown
Raw Permalink Normal View History

2018-11-30 17:31:47 +08:00
# GPIO
2018-12-04 15:00:14 +08:00
中文 | [English](/en/api_reference/micropython/peripherals/api_gpio) | [日本語](/ja/api_reference/micropython/peripherals/api_gpio)
2018-11-30 17:31:47 +08:00
*使用Arduino库的GPIO API*
### <mark>digitalRead</mark>
> uint32 digitalRead(uint8 pin);
读取数字引脚电平值
| Param | Type | Description |
| --- | --- | --- |
| pin | <code>uint8</code> | 引脚编号 |
Return:
电平值(0/1)
**例程**
```c++
uint32_t pin21_data;
pin21_data = digitalRead(21);
```