-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ba57e39
commit 733651c
Showing
6 changed files
with
208 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
||
<a href="https://uiflow2.m5stack.com/?example=https://raw.githubusercontent.com/m5stack/uiflow-micropython/develop/m5f2_examples/unit/ncir/ncir_core_example.m5f2" target="_blank">ncir_core_example.m5f2</a> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,4 @@ Unit | |
dlight.rst | ||
ultrasonic.rst | ||
pir.rst | ||
ncir.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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| | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
||
<a href="https://uiflow2.m5stack.com/?example=https://raw.githubusercontent.com/m5stack/uiflow-micropython/develop/m5f2_examples/unit/ncir/ncir_core_example.m5f2" target="_blank">ncir_core_example.m5f2</a> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,4 @@ Unit | |
dlight.rst | ||
ultrasonic.rst | ||
pir.rst | ||
ncir.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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| | ||
|
||
|