mirror of
https://github.com/letscontrolit/ESPEasy.git
synced 2026-07-27 19:57:38 +00:00
[docs] event+commands for GPIO#N + Monitor added
This commit is contained in:
@@ -219,3 +219,30 @@
|
||||
endon
|
||||
|
||||
"
|
||||
"
|
||||
``GPIO#N``
|
||||
If the command "Monitor" is used to monitor a given pin you will receive an event for that GPIO
|
||||
as soon as it's state changes. As seen in the example you can always use the square brackets
|
||||
together with the task/value name of ``Plugin#GPIO#Pinstate#N`` to get the state, but to
|
||||
trigger events you need to add the monitor command (preferably at boot).
|
||||
","
|
||||
|
||||
.. code-block:: html
|
||||
|
||||
on System#Boot do
|
||||
Monitor GPIO,15
|
||||
endon
|
||||
|
||||
on GPIO#15=0 do
|
||||
if [Plugin#GPIO#Pinstate#13]=0
|
||||
// do something
|
||||
endif
|
||||
endon
|
||||
|
||||
on GPIO#15=1 do
|
||||
if [Plugin#GPIO#Pinstate#13]=1
|
||||
// do something
|
||||
endif
|
||||
endon
|
||||
|
||||
"
|
||||
|
||||
@@ -31,7 +31,7 @@ Supported hardware: |P000_usedby_GPIO|
|
||||
GPIO: 0 ... 16
|
||||
|
||||
","
|
||||
**Toggle on/off.**.
|
||||
**Toggle on/off.**.
|
||||
Toggle the current (output) state of the given GPIO pin.
|
||||
This will only be executed on pins set to be in output mode.
|
||||
"
|
||||
@@ -116,3 +116,11 @@ Supported hardware: |P000_usedby_GPIO|
|
||||
A position value of 9000 will stop the PWM signal.
|
||||
This can be useful to save energy on servos which do not need power to remain at the same position.
|
||||
"
|
||||
"
|
||||
``Monitor,<GPIO>``
|
||||
|
||||
GPIO: 0 ... 16
|
||||
","
|
||||
**To monitor a GPIO state.**
|
||||
By the use of the command you will receive events when the GPIO state of that pin is changed from 1 to 0 and from 0 to 1.
|
||||
"
|
||||
|
||||
Reference in New Issue
Block a user