[docs] event+commands for GPIO#N + Monitor added

This commit is contained in:
Grovkillen
2019-02-14 14:28:58 +01:00
parent c1a0a26cd4
commit 2564bcd4b8
2 changed files with 36 additions and 1 deletions
+27
View File
@@ -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
"
+9 -1
View File
@@ -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.
"