Skip to content

Commit

Permalink
Add Add copyright information of third-party libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
felixlubenben committed Nov 10, 2023
1 parent c6a4345 commit ba57e39
Show file tree
Hide file tree
Showing 6 changed files with 240 additions and 0 deletions.
23 changes: 23 additions & 0 deletions docs/en/refs/unit.pir.ref
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>

1 change: 1 addition & 0 deletions docs/en/units/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ Unit
light.rst
dlight.rst
ultrasonic.rst
pir.rst
96 changes: 96 additions & 0 deletions docs/en/units/pir.rst
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|
23 changes: 23 additions & 0 deletions docs/zh_CN/refs/unit.pir.ref
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>

1 change: 1 addition & 0 deletions docs/zh_CN/unit/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ Unit
light.rst
dlight.rst
ultrasonic.rst
pir.rst
96 changes: 96 additions & 0 deletions docs/zh_CN/unit/pir.rst
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|

0 comments on commit ba57e39

Please sign in to comment.