Files

23 lines
500 B
Markdown
Raw Permalink Normal View History

2018-11-30 17:31:47 +08:00
# GPIO
2018-12-04 15:00:14 +08:00
[中文](/zh_CN/api_reference/micropython/peripherals/api_gpio) | [English](/en/api_reference/micropython/peripherals/api_gpio) | 日本語
2018-11-30 17:31:47 +08:00
*Refer to GPIO API of [Arduino](http://www.arduino.cc)*
### <mark>digitalRead</mark>
> uint32 digitalRead(uint8 pin);
Read the value of `pin`
| Param | Type | Description |
| --- | --- | --- |
| pin | <code>uint8</code> | the number of pin |
Return:
digital level(0/1)
**Example**
```c++
uint32_t pin21_data;
pin21_data = digitalRead(21);
```