diff --git a/docs/doc/assets/si7021.png b/docs/doc/assets/si7021.png new file mode 100644 index 00000000..a756fe27 Binary files /dev/null and b/docs/doc/assets/si7021.png differ diff --git a/docs/doc/en/modules/temp_humi.md b/docs/doc/en/modules/temp_humi.md index eb796efb..16137f07 100644 --- a/docs/doc/en/modules/temp_humi.md +++ b/docs/doc/en/modules/temp_humi.md @@ -4,10 +4,17 @@ title: Reading Temperature and Humidity Sensors with MaixCAM MaixPy ## Introduction -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`. +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. -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). +![](../../assets/si7021.png) -Note that the system image needs to be version `>= 2024.6.3_maixpy_v4.2.1`. +**Note**: The power supply should be 3.3V. Connecting it to 5V may cause damage. +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)`. + +## Usage + +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. + +**Note**: The system image version must be `>= 2024.6.3_maixpy_v4.2.1`. diff --git a/docs/doc/zh/modules/temp_humi.md b/docs/doc/zh/modules/temp_humi.md index 88a5b34f..5886244d 100644 --- a/docs/doc/zh/modules/temp_humi.md +++ b/docs/doc/zh/modules/temp_humi.md @@ -4,11 +4,17 @@ title: MaixCAM MaixPy 读取温湿度传感器 ## 简介 -通过给 MaixCAM 外挂一个温湿度传感器模块,可以轻松读取到环境温度和湿度,这里以 `Si7021` 这款传感器为例,通过 `I2C` 可以驱动它。 +通过给 MaixCAM 外挂一个温湿度传感器模块,可以轻松读取到环境温度和湿度,这里以 `Si7021` 这款传感器为例,通过 `I2C` 可以驱动它,其它的传感器你也可以找厂商要驱动然后使用 I2C / SPI 读取。 + +![](../../assets/si7021.png) + +注意供电是 3.3v,不要接错到 5v 导致烧毁。 + +`SCL` / `SDA` 接到 MaixCAM 的 `SCL` / `SDA` 即可,比如 `I2C5` 对应的`A15(SCL)/ A27(SDA)`。 ## 使用 -完整的代码在[MaixPy/examples/ext_dev/sensors/temp_humi_si7021.py](https://github.com/sipeed/MaixPy/blob/main/examples/sensors/temp_humi_si7021.py) +完整的代码在 [MaixPy/examples/ext_dev/sensors](https://github.com/sipeed/MaixPy/blob/main/examples/ext_dev/sensors) 目录下, 找到`si7021` 的例程即可。 注意系统镜像需要 `>= 2024.6.3_maixpy_v4.2.1` 版本。 diff --git a/examples/tools/install_runtime.py b/examples/tools/install_runtime.py index 60133c24..7ee7b420 100644 --- a/examples/tools/install_runtime.py +++ b/examples/tools/install_runtime.py @@ -1,6 +1,9 @@ import os -def install_runtime(): +def install_runtime(force = False): + version_path = "/maixapp/maixcam_lib.version" + if force and os.path.exists(version_path): + os.remove(version_path) cmd = f"chmod +x /maixapp/apps/settings/settings && /maixapp/apps/settings/settings install_runtime" err_code = os.system(cmd) if err_code != 0: @@ -8,4 +11,6 @@ def install_runtime(): else: print(f"Install runtime success") -install_runtime() + +force_reinstall = False # reinstall runtime even we alredy installed. +install_runtime(force_reinstall)