-
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.
Add Add copyright information of third-party libraries
- Loading branch information
1 parent
c6a4345
commit ba57e39
Showing
6 changed files
with
240 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,23 @@ | ||
.. |PIR| image:: https://static-cdn.m5stack.com/resource/docs/products/unit/PIR/img-4647c010-1e57-4cc9-85e3-cbd450882074.webp | ||
:target: https://docs.m5stack.com/en/unit/PIR | ||
:height: 200px | ||
:width: 200 px | ||
|
||
|
||
.. |example.svg| image:: https://static-cdn.m5stack.com/mpy_docs/unit/pir/example.svg | ||
|
||
.. |init.svg| image:: https://static-cdn.m5stack.com/mpy_docs/unit/pir/init.svg | ||
|
||
.. |get_status.svg| image:: https://static-cdn.m5stack.com/mpy_docs/unit/pir/get_status.svg | ||
|
||
.. |enable_irq.svg| image:: https://static-cdn.m5stack.com/mpy_docs/unit/pir/enable_irq.svg | ||
|
||
.. |disable_irq.svg| image:: https://static-cdn.m5stack.com/mpy_docs/unit/pir/disable_irq.svg | ||
|
||
.. |set_callback.svg| image:: https://static-cdn.m5stack.com/mpy_docs/unit/pir/set_callback.svg | ||
|
||
|
||
.. |pir_core_example.m5f2| raw:: html | ||
|
||
<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> | ||
|
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 |
---|---|---|
|
@@ -14,3 +14,4 @@ Unit | |
light.rst | ||
dlight.rst | ||
ultrasonic.rst | ||
pir.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,96 @@ | ||
PIR Unit | ||
================== | ||
|
||
.. include:: ../refs/unit.pir.ref | ||
|
||
Support the following products: | ||
|
||
|
||
|PIR| | ||
|
||
|
||
Micropython Example:: | ||
|
||
import os, sys, io | ||
import M5 | ||
from M5 import * | ||
from hardware import * | ||
from unit import * | ||
|
||
i2c0 = None | ||
pir_0 = None | ||
|
||
def setup(): | ||
global i2c0, pir_0 | ||
|
||
i2c0 = I2C(0, scl=Pin(1), sda=Pin(2), freq=100000) | ||
pir_0 = PIR((8, 9)) | ||
M5.begin() | ||
Widgets.fillScreen(0x222222) | ||
|
||
print(pir_0.get_status()) | ||
|
||
|
||
|
||
UIFLOW2 Example: | ||
|
||
|example.svg| | ||
|
||
.. only:: builder_html | ||
|
||
|pir_core_example.m5f2| | ||
|
||
class PIR | ||
----------------- | ||
|
||
Constructors | ||
-------------- | ||
|
||
.. class:: PIR(IO1,IO2) | ||
|
||
Create a PIR object. | ||
|
||
The parameters are: | ||
- ``IO1,IO2`` I2C pin. | ||
|
||
|
||
UIFLOW2: | ||
|
||
|init.svg| | ||
|
||
|
||
Methods | ||
------- | ||
|
||
.. method:: PIR.get_status() | ||
|
||
|
||
Get detection status. | ||
|
||
UIFLOW2: | ||
|
||
|get_status.svg| | ||
|
||
.. method:: PIR.enable_irq() | ||
|
||
Enable Human detection function. | ||
|
||
UIFLOW2: | ||
|
||
|enable_irq.svg| | ||
|
||
.. method:: PIR.disable_irq() | ||
|
||
Disable Human detection function. | ||
|
||
UIFLOW2: | ||
|
||
|disable_irq.svg| | ||
|
||
.. method:: PIR.set_callback() | ||
|
||
Polling method, placed in the loop function, constantly check. | ||
|
||
UIFLOW2: | ||
|
||
|set_callback.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,23 @@ | ||
.. |PIR| image:: https://static-cdn.m5stack.com/resource/docs/products/unit/PIR/img-4647c010-1e57-4cc9-85e3-cbd450882074.webp | ||
:target: https://docs.m5stack.com/zh_CN/unit/PIR | ||
:height: 200px | ||
:width: 200 px | ||
|
||
|
||
.. |example.svg| image:: https://static-cdn.m5stack.com/mpy_docs/unit/pir/example.svg | ||
|
||
.. |init.svg| image:: https://static-cdn.m5stack.com/mpy_docs/unit/pir/init.svg | ||
|
||
.. |get_status.svg| image:: https://static-cdn.m5stack.com/mpy_docs/unit/pir/get_status.svg | ||
|
||
.. |enable_irq.svg| image:: https://static-cdn.m5stack.com/mpy_docs/unit/pir/enable_irq.svg | ||
|
||
.. |disable_irq.svg| image:: https://static-cdn.m5stack.com/mpy_docs/unit/pir/disable_irq.svg | ||
|
||
.. |set_callback.svg| image:: https://static-cdn.m5stack.com/mpy_docs/unit/pir/set_callback.svg | ||
|
||
|
||
.. |pir_core_example.m5f2| raw:: html | ||
|
||
<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> | ||
|
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 |
---|---|---|
|
@@ -14,3 +14,4 @@ Unit | |
light.rst | ||
dlight.rst | ||
ultrasonic.rst | ||
pir.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,96 @@ | ||
PIR Unit | ||
================== | ||
|
||
.. include:: ../refs/unit.pir.ref | ||
|
||
Support the following products: | ||
|
||
|
||
|PIR| | ||
|
||
|
||
Micropython Example:: | ||
|
||
import os, sys, io | ||
import M5 | ||
from M5 import * | ||
from hardware import * | ||
from unit import * | ||
|
||
i2c0 = None | ||
pir_0 = None | ||
|
||
def setup(): | ||
global i2c0, pir_0 | ||
|
||
i2c0 = I2C(0, scl=Pin(1), sda=Pin(2), freq=100000) | ||
pir_0 = PIR((8, 9)) | ||
M5.begin() | ||
Widgets.fillScreen(0x222222) | ||
|
||
print(pir_0.get_status()) | ||
|
||
|
||
|
||
UIFLOW2 Example: | ||
|
||
|example.svg| | ||
|
||
.. only:: builder_html | ||
|
||
|pir_core_example.m5f2| | ||
|
||
class PIR | ||
----------------- | ||
|
||
Constructors | ||
-------------- | ||
|
||
.. class:: PIR(IO1,IO2) | ||
|
||
创建一个PIR对象. | ||
|
||
参数是: | ||
- ``IO1,IO2`` I2C引脚。 | ||
|
||
|
||
UIFLOW2: | ||
|
||
|init.svg| | ||
|
||
|
||
Methods | ||
------- | ||
|
||
.. method:: PIR.get_status() | ||
|
||
|
||
获取检测状态 | ||
|
||
UIFLOW2: | ||
|
||
|get_status.svg| | ||
|
||
.. method:: PIR.enable_irq() | ||
|
||
使能人体检测功能。 | ||
|
||
UIFLOW2: | ||
|
||
|enable_irq.svg| | ||
|
||
.. method:: PIR.disable_irq() | ||
|
||
关闭人体检测功能。 | ||
|
||
UIFLOW2: | ||
|
||
|disable_irq.svg| | ||
|
||
.. method:: PIR.set_callback() | ||
|
||
轮询方法,放在loop函数里面,不断检测。 | ||
|
||
UIFLOW2: | ||
|
||
|set_callback.svg| |