This commit is contained in:
shark 2025-05-27 20:16:07 +08:00
commit 485dc9a752
5 changed files with 152 additions and 0 deletions

3
README.md Normal file
View File

@ -0,0 +1,3 @@
```bash
pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
```

View File

@ -0,0 +1,69 @@
## 引脚操作
* **pinMode(pin, mode)**
设置引脚的工作模式。
* `pin`:引脚编号
* `mode`:可以是
* `INPUT`:输入模式
* `OUTPUT`:输出模式
* `INPUT_PULLUP`:带内部上拉电阻的输入模式
示例:
```cpp
pinMode(13, OUTPUT);
pinMode(2, INPUT);
pinMode(3, INPUT_PULLUP);
```
* **digitalWrite(pin, value)**
控制数字引脚输出高电平或低电平。
* `value`:可以是 `HIGH``LOW`
示例:
```cpp
digitalWrite(13, HIGH); // 输出高电平
digitalWrite(13, LOW); // 输出低电平
```
* `value`:可以是 `1``0`
示例:
```cpp
digitalWrite(13, 1); // 输出高电平
digitalWrite(13, 0); // 输出低电平
```
* **digitalRead(pin)**
读取数字引脚的电平状态。返回值是 `HIGH``LOW`
示例:
```cpp
int state = digitalRead(2);
if (state == HIGH) {
// 引脚为高电平
}
```
* **analogRead(pin)**
读取模拟引脚的电压值,返回值范围为 `0 ~ 1023`
* 通常用于 A0\~A5
示例:
```cpp
int value = analogRead(A0);
```
* **analogWrite(pin, value)**
使用 PWM 输出模拟信号。
* `value` 范围为 `0 ~ 255`,对应输出占空比
* 仅适用于支持 PWM 的引脚(如 3、5、6、9、10、11
示例:
```cpp
analogWrite(9, 128); // 50% 占空比
```

1
docs/index.md Normal file
View File

@ -0,0 +1 @@
# 测试

79
mkdocs.yml Normal file
View File

@ -0,0 +1,79 @@
site_name: hugemaker
site_description: hugemaker
site_author: hugemaker
# site_url: # 请在这里填写您的网站URL
strict: false
repo_name: '/doc'
repo_url:
nav:
- 简介:
- 介绍: index.md
- arduino:
- arduino内置函数: arduino内置函数.md
theme:
name: material
language: zh
palette:
- media: "(prefers-color-scheme: light)"
scheme: default
primary: white
accent: indigo
toggle:
icon: material/weather-sunny
name: 切换到夜间模式
- media: "(prefers-color-scheme: dark)"
scheme: slate
primary: blue-grey
accent: cyan
toggle:
icon: material/weather-night
name: 切换到日间模式
features:
- navigation.tabs
- navigation.instant
- content.action.edit
font:
text: Fira Sans
code: Fira Mono
icon:
logo: material/school
markdown_extensions:
- admonition
- def_list
- footnotes
- meta
- toc:
permalink: ""
- pymdownx.arithmatex:
generic: true
- pymdownx.caret
- pymdownx.critic
- pymdownx.details
- pymdownx.emoji:
emoji_generator: !!python/name:pymdownx.emoji.to_svg
- pymdownx.highlight:
linenums: true
- pymdownx.inlinehilite
- pymdownx.keys
- pymdownx.magiclink
- pymdownx.mark
- pymdownx.smartsymbols
- pymdownx.superfences:
custom_fences:
- name: math
class: arithmatex
format: !!python/name:pymdownx.arithmatex.fence_mathjax_format
- pymdownx.tasklist:
custom_checkbox: true
- pymdownx.tilde
- pymdownx.tabbed:
alternate_style: true
extra_javascript:
- https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js

BIN
requirements.txt Normal file

Binary file not shown.