Skip to content

Commit 6ec4263

Browse files
committed
Merge remote-tracking branch 'origin/develop' into develop-pandian
2 parents 9f298e9 + 09001ee commit 6ec4263

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+3104
-85
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,5 @@ genrst/
5050
.vscode/
5151
tools/littlefs/prebuilt/
5252

53-
dependencies.lock
53+
dependencies.lock
54+
m5stack/.workenv

docs/en/refs/unit.ncir.ref

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.. |NCIR| image:: https://static-cdn.m5stack.com/resource/docs/products/unit/ncir/ncir_01.webp
2+
:target: https://docs.m5stack.com/en/unit/ncir
3+
:height: 200px
4+
:width: 200 px
5+
6+
7+
.. |example.svg| image:: https://m5stack.oss-cn-shenzhen.aliyuncs.com/mpy_docs/unit/ncir/example.svg
8+
9+
.. |init.svg| image:: https://m5stack.oss-cn-shenzhen.aliyuncs.com/mpy_docs/unit/ncir/init.svg
10+
11+
.. |get_ambient_temperature.svg| image:: https://m5stack.oss-cn-shenzhen.aliyuncs.com/mpy_docs/unit/ncir/get_object_temperature.svg
12+
13+
.. |get_object_temperature.svg| image:: https://static-cdn.m5stack.com/mpy_docs/unit/pir/enable_irq.svg
14+
15+
16+
17+
.. |ncir_core_example.m5f2| raw:: html
18+
19+
<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>
20+

docs/en/refs/unit.op180.ref

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
.. |OP180| image:: https://static-cdn.m5stack.com/resource/docs/products/unit/OP180/img-a3e126ec-af40-4f42-a85e-880460d46f7d.webp
2+
:target: https://docs.m5stack.com/en/unit/OP180
3+
:height: 200px
4+
:width: 200 px
5+
6+
7+
.. |example.svg| image:: https://static-cdn.m5stack.com/mpy_docs/unit/op180/example.svg
8+
9+
.. |init.svg| image:: https://static-cdn.m5stack.com/mpy_docs/unit/op180/init.svg
10+
11+
.. |get_switch_value.svg| image:: https://static-cdn.m5stack.com/mpy_docs/unit/op180/get_switch_value.svg
12+
13+
.. |get_count_value.svg| image:: https://static-cdn.m5stack.com/mpy_docs/unit/op180/get_counter_value.svg
14+
15+
.. |reset_count_value.svg| image:: https://static-cdn.m5stack.com/mpy_docs/unit/op180/reset_counter_value.svg
16+
17+
18+
19+
.. |op180_core_example.m5f2| raw:: html
20+
21+
<a href="https://uiflow2.m5stack.com/?example=https://raw.githubusercontent.com/m5stack/uiflow-micropython/develop/m5f2_examples/unit/op180/op180_core_example.m5f2" target="_blank">op180_core_example.m5f2</a>
22+

docs/en/refs/unit.op90.ref

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
.. |OP90| image:: https://static-cdn.m5stack.com/resource/docs/products/unit/OP.90/img-103a3854-fbc1-43a3-9ebe-88cf6051e273.webp
2+
:target: https://docs.m5stack.com/en/unit/OP.90
3+
:height: 200px
4+
:width: 200 px
5+
6+
7+
.. |example.svg| image:: https://static-cdn.m5stack.com/mpy_docs/unit/op90/example.svg
8+
9+
.. |init.svg| image:: https://static-cdn.m5stack.com/mpy_docs/unit/op90/init.svg
10+
11+
.. |get_switch_value.svg| image:: https://static-cdn.m5stack.com/mpy_docs/unit/op90/get_switch_value.svg
12+
13+
.. |get_count_value.svg| image:: https://static-cdn.m5stack.com/mpy_docs/unit/op90/get_counter_value.svg
14+
15+
.. |reset_count_value.svg| image:: https://static-cdn.m5stack.com/mpy_docs/unit/op90/reset_counter_value.svg
16+
17+
18+
19+
.. |op90_core_example.m5f2| raw:: html
20+
21+
<a href="https://uiflow2.m5stack.com/?example=https://raw.githubusercontent.com/m5stack/uiflow-micropython/develop/m5f2_examples/unit/op90/op90_core_example.m5f2" target="_blank">op90_core_example.m5f2</a>
22+

docs/en/refs/unit.pir.ref

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.. |PIR| image:: https://static-cdn.m5stack.com/resource/docs/products/unit/PIR/img-4647c010-1e57-4cc9-85e3-cbd450882074.webp
2+
:target: https://docs.m5stack.com/en/unit/PIR
3+
:height: 200px
4+
:width: 200 px
5+
6+
7+
.. |example.svg| image:: https://static-cdn.m5stack.com/mpy_docs/unit/pir/example.svg
8+
9+
.. |init.svg| image:: https://static-cdn.m5stack.com/mpy_docs/unit/pir/init.svg
10+
11+
.. |get_status.svg| image:: https://static-cdn.m5stack.com/mpy_docs/unit/pir/get_status.svg
12+
13+
.. |enable_irq.svg| image:: https://static-cdn.m5stack.com/mpy_docs/unit/pir/enable_irq.svg
14+
15+
.. |disable_irq.svg| image:: https://static-cdn.m5stack.com/mpy_docs/unit/pir/disable_irq.svg
16+
17+
.. |set_callback.svg| image:: https://static-cdn.m5stack.com/mpy_docs/unit/pir/set_callback.svg
18+
19+
20+
.. |pir_core_example.m5f2| raw:: html
21+
22+
<a href="https://uiflow2.m5stack.com/?example=https://raw.githubusercontent.com/m5stack/uiflow-micropython/develop/m5f2_examples/unit/pir/pir_core_example.m5f2" target="_blank">pir_core_example.m5f2</a>
23+

docs/en/refs/unit.relay.ref

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
.. |RELAY| image:: https://static-cdn.m5stack.com/resource/docs/products/unit/relay/relay_01.webp
2+
:target: https://docs.m5stack.com/en/unit/relay
3+
:height: 200px
4+
:width: 200 px
5+
6+
7+
.. |example.svg| image:: https://static-cdn.m5stack.com/mpy_docs/unit/relay/example.svg
8+
9+
.. |init.svg| image:: https://static-cdn.m5stack.com/mpy_docs/unit/relay/init.svg
10+
11+
.. |get_status.svg| image:: https://static-cdn.m5stack.com/mpy_docs/unit/relay/get_status.svg
12+
13+
.. |on.svg| image:: https://static-cdn.m5stack.com/mpy_docs/unit/relay/on.svg
14+
15+
.. |off.svg| image:: https://static-cdn.m5stack.com/mpy_docs/unit/relay/off.svg
16+
17+
.. |set_status.svg| image:: https://static-cdn.m5stack.com/mpy_docs/unit/relay/set_status.svg
18+
19+
20+
21+
.. |relay_core_example.m5f2| raw:: html
22+
23+
<a href="https://uiflow2.m5stack.com/?example=https://raw.githubusercontent.com/m5stack/uiflow-micropython/develop/m5f2_examples/unit/relay/relay_core_example.m5f2" target="_blank">relay_core_example.m5f2</a>
24+

docs/en/units/index.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,8 @@ Unit
1414
light.rst
1515
dlight.rst
1616
ultrasonic.rst
17+
pir.rst
18+
ncir.rst
19+
relay.rst
20+
op90.rst
21+
op180.rst

docs/en/units/ncir.rst

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
NCIR Unit
2+
==================
3+
4+
.. include:: ../refs/unit.ncir.ref
5+
6+
Support the following products:
7+
8+
9+
|NCIR|
10+
11+
12+
Micropython Example::
13+
14+
import os, sys, io
15+
import M5
16+
from M5 import *
17+
from hardware import *
18+
from unit import *
19+
20+
i2c0 = None
21+
ncir_0 = None
22+
23+
def setup():
24+
global i2c0, ncir_0
25+
26+
i2c0 = I2C(0, scl=Pin(1), sda=Pin(2), freq=100000)
27+
ncir_0 = NCIRUnit(i2c0)
28+
M5.begin()
29+
Widgets.fillScreen(0x222222)
30+
31+
print(ncir_0.get_ambient_temperature())
32+
print(ncir_0.get_object_temperature())
33+
34+
35+
36+
UIFLOW2 Example:
37+
38+
|example.svg|
39+
40+
.. only:: builder_html
41+
42+
|ncir_core_example.m5f2|
43+
44+
class NCIRUnit
45+
-----------------
46+
47+
Constructors
48+
--------------
49+
50+
.. class:: NCIRUnit(i2c)
51+
52+
Create an NCIRUnit object.
53+
54+
The parameters is:
55+
- ``i2c`` Define the i2c pin.
56+
57+
58+
UIFLOW2:
59+
60+
|init.svg|
61+
62+
63+
Methods
64+
-------
65+
66+
.. method:: ncir.get_ambient_temperature()
67+
68+
69+
Obtain the ambient temperature.
70+
71+
UIFLOW2:
72+
73+
|get_ambient_temperature.svg|
74+
75+
.. method:: ncir.get_object_temperature()
76+
77+
Get the temperature of the measured object.
78+
79+
UIFLOW2:
80+
81+
|get_object_temperature.svg|
82+
83+

docs/en/units/op180.rst

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
OP180 Unit
2+
==================
3+
4+
.. include:: ../refs/unit.OP180.ref
5+
6+
The following products are supported:
7+
8+
9+
|OP180|
10+
11+
12+
Micropython Example::
13+
14+
import os, sys, io
15+
import M5
16+
from M5 import *
17+
import time
18+
from unit import *
19+
20+
op180_0 = None
21+
22+
def setup():
23+
global op180_0
24+
25+
op180_0 = OPUnit((8, 9), type=1)
26+
M5.begin()
27+
Widgets.fillScreen(0x222222)
28+
29+
print(op180_0.get_value)
30+
time.sleep(1)
31+
print(op180_0.count_value)
32+
time.sleep(1)
33+
op180_0.count_reset()
34+
time.sleep(1)
35+
36+
37+
38+
UIFLOW2 Example:
39+
40+
|example.svg|
41+
42+
.. only:: builder_html
43+
44+
|op180_core_example.m5f2|
45+
46+
class OPUnit
47+
-----------------
48+
49+
Constructors
50+
--------------
51+
52+
.. class:: OP180(io)
53+
54+
Create an OP180 object.
55+
56+
The parameters is:
57+
- ``io`` is the detection pin.
58+
59+
60+
UIFLOW2:
61+
62+
|init.svg|
63+
64+
65+
Methods
66+
-------
67+
68+
.. method:: OP180.get_value()
69+
70+
71+
Gets the switch status.
72+
73+
UIFLOW2:
74+
75+
|get_switch_value.svg|
76+
77+
.. method:: OP180.count_value()
78+
79+
Get the count value.
80+
81+
UIFLOW2:
82+
83+
|get_count_value.svg|
84+
85+
.. method:: OP108.count_reset()
86+
87+
Reset the meter value.
88+
89+
UIFLOW2:
90+
91+
|reset_count_value.svg|
92+
93+
94+

0 commit comments

Comments
 (0)