Skip to content

Commit fc20f08

Browse files
committed
update doc
1 parent fbd41d2 commit fc20f08

File tree

4 files changed

+25
-7
lines changed

4 files changed

+25
-7
lines changed

docs/doc/assets/si7021.png

215 KB
Loading

docs/doc/en/modules/temp_humi.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,17 @@ title: Reading Temperature and Humidity Sensors with MaixCAM MaixPy
44

55
## Introduction
66

7-
By attaching a temperature and humidity sensor module to MaixCAM, you can easily read the environmental temperature and humidity. This example uses the `Si7021` sensor, which can be driven via `I2C`.
7+
By attaching a temperature and humidity sensor module to the MaixCAM, you can easily measure the environmental temperature and humidity. Here, we use the `Si7021` sensor as an example, which can be driven using `I2C`. For other sensors, you can request drivers from the manufacturer and use `I2C` or `SPI` to read data from them.
88

9-
The complete code is available at [MaixPy/examples/sensors/temp_humi_si7021.py](https://github.com/sipeed/MaixPy/blob/main/examples/sensors/temp_humi_si7021.py).
9+
![](../../assets/si7021.png)
1010

11-
Note that the system image needs to be version `>= 2024.6.3_maixpy_v4.2.1`.
11+
**Note**: The power supply should be 3.3V. Connecting it to 5V may cause damage.
1212

13+
Connect the `SCL` / `SDA` pins of the sensor to the corresponding `SCL` / `SDA` pins on the MaixCAM. For instance, on `I2C5`, this corresponds to `A15(SCL)` / `A27(SDA)`.
14+
15+
## Usage
16+
17+
The complete code can be found in the [MaixPy/examples/ext_dev/sensors](https://github.com/sipeed/MaixPy/blob/main/examples/ext_dev/sensors) directory. Look for the `si7021` example.
18+
19+
**Note**: The system image version must be `>= 2024.6.3_maixpy_v4.2.1`.
1320

docs/doc/zh/modules/temp_humi.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,17 @@ title: MaixCAM MaixPy 读取温湿度传感器
44

55
## 简介
66

7-
通过给 MaixCAM 外挂一个温湿度传感器模块,可以轻松读取到环境温度和湿度,这里以 `Si7021` 这款传感器为例,通过 `I2C` 可以驱动它。
7+
通过给 MaixCAM 外挂一个温湿度传感器模块,可以轻松读取到环境温度和湿度,这里以 `Si7021` 这款传感器为例,通过 `I2C` 可以驱动它,其它的传感器你也可以找厂商要驱动然后使用 I2C / SPI 读取。
8+
9+
![](../../assets/si7021.png)
10+
11+
注意供电是 3.3v,不要接错到 5v 导致烧毁。
12+
13+
`SCL` / `SDA` 接到 MaixCAM 的 `SCL` / `SDA` 即可,比如 `I2C5` 对应的`A15(SCL)/ A27(SDA)`
814

915
## 使用
1016

11-
完整的代码在[MaixPy/examples/ext_dev/sensors/temp_humi_si7021.py](https://github.com/sipeed/MaixPy/blob/main/examples/sensors/temp_humi_si7021.py)
17+
完整的代码在 [MaixPy/examples/ext_dev/sensors](https://github.com/sipeed/MaixPy/blob/main/examples/ext_dev/sensors) 目录下, 找到`si7021` 的例程即可。
1218

1319
注意系统镜像需要 `>= 2024.6.3_maixpy_v4.2.1` 版本。
1420

examples/tools/install_runtime.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
import os
22

3-
def install_runtime():
3+
def install_runtime(force = False):
4+
version_path = "/maixapp/maixcam_lib.version"
5+
if force and os.path.exists(version_path):
6+
os.remove(version_path)
47
cmd = f"chmod +x /maixapp/apps/settings/settings && /maixapp/apps/settings/settings install_runtime"
58
err_code = os.system(cmd)
69
if err_code != 0:
710
print("[ERROR] Install failed, error code:", err_code)
811
else:
912
print(f"Install runtime success")
1013

11-
install_runtime()
14+
15+
force_reinstall = False # reinstall runtime even we alredy installed.
16+
install_runtime(force_reinstall)

0 commit comments

Comments
 (0)