diff --git a/docs/en/refs/unit.ncir.ref b/docs/en/refs/unit.ncir.ref new file mode 100644 index 00000000..9a4188e5 --- /dev/null +++ b/docs/en/refs/unit.ncir.ref @@ -0,0 +1,20 @@ +.. |NCIR| image:: https://static-cdn.m5stack.com/resource/docs/products/unit/ncir/ncir_01.webp + :target: https://docs.m5stack.com/en/unit/ncir + :height: 200px + :width: 200 px + + +.. |example.svg| image:: https://m5stack.oss-cn-shenzhen.aliyuncs.com/mpy_docs/unit/ncir/example.svg + +.. |init.svg| image:: https://m5stack.oss-cn-shenzhen.aliyuncs.com/mpy_docs/unit/ncir/init.svg + +.. |get_ambient_temperature.svg| image:: https://m5stack.oss-cn-shenzhen.aliyuncs.com/mpy_docs/unit/ncir/get_object_temperature.svg + +.. |get_object_temperature.svg| image:: https://static-cdn.m5stack.com/mpy_docs/unit/pir/enable_irq.svg + + + +.. |ncir_core_example.m5f2| raw:: html + + ncir_core_example.m5f2 + diff --git a/docs/en/units/index.rst b/docs/en/units/index.rst index fe77216f..4b9fa126 100644 --- a/docs/en/units/index.rst +++ b/docs/en/units/index.rst @@ -15,3 +15,4 @@ Unit dlight.rst ultrasonic.rst pir.rst + ncir.rst diff --git a/docs/en/units/ncir.rst b/docs/en/units/ncir.rst new file mode 100644 index 00000000..68392d2d --- /dev/null +++ b/docs/en/units/ncir.rst @@ -0,0 +1,83 @@ +NCIR Unit +================== + +.. include:: ../refs/unit.ncir.ref + +Support the following products: + + +|NCIR| + + +Micropython Example:: + + import os, sys, io + import M5 + from M5 import * + from hardware import * + from unit import * + + i2c0 = None + ncir_0 = None + + def setup(): + global i2c0, ncir_0 + + i2c0 = I2C(0, scl=Pin(1), sda=Pin(2), freq=100000) + ncir_0 = NCIRUnit(i2c0) + M5.begin() + Widgets.fillScreen(0x222222) + + print(ncir_0.get_ambient_temperature()) + print(ncir_0.get_object_temperature()) + + + +UIFLOW2 Example: + + |example.svg| + +.. only:: builder_html + +|ncir_core_example.m5f2| + +class NCIRUnit +----------------- + +Constructors +-------------- + +.. class:: NCIRUnit(i2c) + + Create an NCIRUnit object. + + The parameters is: + - ``i2c`` Define the i2c pin. + + + UIFLOW2: + + |init.svg| + + +Methods +------- + +.. method:: ncir.get_ambient_temperature() + + + Obtain the ambient temperature. + + UIFLOW2: + + |get_ambient_temperature.svg| + +.. method:: ncir.get_object_temperature() + + Get the temperature of the measured object. + + UIFLOW2: + + |get_object_temperature.svg| + + diff --git a/docs/zh_CN/refs/unit.ncir.ref b/docs/zh_CN/refs/unit.ncir.ref new file mode 100644 index 00000000..c5ae8dba --- /dev/null +++ b/docs/zh_CN/refs/unit.ncir.ref @@ -0,0 +1,20 @@ +.. |NCIR| image:: https://static-cdn.m5stack.com/resource/docs/products/unit/ncir/ncir_01.webp + :target: https://docs.m5stack.com/zh_CN/unit/ncir + :height: 200px + :width: 200 px + + +.. |example.svg| image:: https://m5stack.oss-cn-shenzhen.aliyuncs.com/mpy_docs/unit/ncir/example.svg + +.. |init.svg| image:: https://m5stack.oss-cn-shenzhen.aliyuncs.com/mpy_docs/unit/ncir/init.svg + +.. |get_ambient_temperature.svg| image:: https://m5stack.oss-cn-shenzhen.aliyuncs.com/mpy_docs/unit/ncir/get_object_temperature.svg + +.. |get_object_temperature.svg| image:: https://static-cdn.m5stack.com/mpy_docs/unit/pir/enable_irq.svg + + + +.. |ncir_core_example.m5f2| raw:: html + + ncir_core_example.m5f2 + diff --git a/docs/zh_CN/unit/index.rst b/docs/zh_CN/unit/index.rst index fe77216f..4b9fa126 100644 --- a/docs/zh_CN/unit/index.rst +++ b/docs/zh_CN/unit/index.rst @@ -15,3 +15,4 @@ Unit dlight.rst ultrasonic.rst pir.rst + ncir.rst diff --git a/docs/zh_CN/unit/ncir.rst b/docs/zh_CN/unit/ncir.rst new file mode 100644 index 00000000..fdcd95d4 --- /dev/null +++ b/docs/zh_CN/unit/ncir.rst @@ -0,0 +1,83 @@ +NCIR Unit +================== + +.. include:: ../refs/unit.ncir.ref + +Support the following products: + + +|NCIR| + + +Micropython Example:: + + import os, sys, io + import M5 + from M5 import * + from hardware import * + from unit import * + + i2c0 = None + ncir_0 = None + + def setup(): + global i2c0, ncir_0 + + i2c0 = I2C(0, scl=Pin(1), sda=Pin(2), freq=100000) + ncir_0 = NCIRUnit(i2c0) + M5.begin() + Widgets.fillScreen(0x222222) + + print(ncir_0.get_ambient_temperature()) + print(ncir_0.get_object_temperature()) + + + +UIFLOW2 Example: + + |example.svg| + +.. only:: builder_html + +|ncir_core_example.m5f2| + +class NCIRUnit +----------------- + +Constructors +-------------- + +.. class:: NCIRUnit(i2c) + + 创建一个NCIRUnit对象. + + The parameters is: + - ``i2c`` 定义i2c引脚。 + + + UIFLOW2: + + |init.svg| + + +Methods +------- + +.. method:: ncir.get_ambient_temperature() + + + 获取环境温度。 + + UIFLOW2: + + |get_ambient_temperature.svg| + +.. method:: ncir.get_object_temperature() + + 获取测量物体温度。 + + UIFLOW2: + + |get_object_temperature.svg| + +