Merge pull request #2094 from Grovkillen/DocumentationUpdate

[docs] Added servo motor and plugin sections
This commit is contained in:
Grovkillen
2018-11-27 15:58:03 +01:00
committed by GitHub
12 changed files with 275 additions and 86 deletions
+10 -3
View File
@@ -205,8 +205,15 @@ Rules examples
.. code-block:: html
//Code below...
On Switch#State Do
if [Switch#State]=1
GPIO,12,1
else
GPIO,12,0
endif
EndOn
This rule will turn the relay ON when the button is pressed, and OFF when released.
Indicators (recommended settings)
---------------------------------
@@ -273,8 +280,8 @@ transistor or FET to get it to work. This has one advantage: It inverts the swit
.. image:: P000_Relay_9.jpg
Boards with 12V
~~~~~~~~~~~~~~~
Special designed boards
~~~~~~~~~~~~~~~~~~~~~~~
There are some boards in the wild which can be configured if "low" or "high" should switch the relay on.
With this boards you will have to experiment a bit with your ESP and the board, there should be a combination that works.
+32 -14
View File
@@ -6,13 +6,22 @@ Servo motor
|P000_typename|
|P000_status|
.. image:: P000_Servo_motor_1.jpg
Introduction
------------
Usual servos can turn about 180° (90° in both directions from zero point).
There are some rare servos with 270° turn. If you use a 180° type you may turn it 90° to the left or to the right.
.. danger::
Trying to turn a servo more then what it can handle will run the servo against a stopper inside the gear.
As ESP Easy tries to go further the servo starts humming and gets hot, it will die over time.
The third type "continuous turn servo" is not supported at this time.
Specifications:
* Controlling servo motors using pwm
* Controlling servo motors using PWM
Wiring
@@ -21,10 +30,8 @@ Wiring
.. code-block:: html
ESP S8
GPIO (X) <--> TX
GPIO (X) <--> RX
ESP Servo
GPIO (X) <--> S (signal)
Power
5.0V <--> VCC
@@ -34,24 +41,35 @@ Wiring
Setup
-----
No device is needed, generally you use rules to activate servos, or you send commands to activate them. Below you
find more information on how to do this.
Rules examples
--------------
.. code-block:: html
//Code below...
On Switch#State Do
if [Switch#State]=1
Servo,12,1,-45
Servo,14,2,45
else
Servo,12,1,0
Servo,14,2,0
endif
EndOn
This rule will tilt the servos 45° when the button is pressed, and it'll go back to 0 once released.
Indicators (recommended settings)
---------------------------------
.. csv-table::
:header: "Indicator", "Value Name", "Interval", "Decimals", "Extra information"
:widths: 8, 5, 5, 5, 40
No device is needed.
"XXXXXX", "N/A", "", "", ""
Commands
--------
.. include:: P001_commands_GPIO.rst
Where to buy
------------
@@ -60,10 +78,10 @@ Where to buy
:header: "Store", "Link"
:widths: 5, 40
"AliExpress","`Link 1 ($) <http://s.click.aliexpress.com/e/cg1fhDDI>`_"
"AliExpress","`Link 1 ($) <http://s.click.aliexpress.com/e/c5RaXUgu>`_"
|affiliate|
More pictures
-------------
.. More pictures
.. -------------
Binary file not shown.

After

Width:  |  Height:  |  Size: 864 KiB

+4 -7
View File
@@ -167,19 +167,18 @@
Event command
-------------
~~~~~~~~~~~~~
The event command is a special command used to trigger an event. This event can then be acted upon from the rules.
You can send 0..4 event values along with the event.
.. csv-table::
:header: "Command", "Rules example"
:widths: 10, 15
:header: "Event"
:widths: 100
"
``Event,SingleEvent``
","
.. code-block:: html
@@ -192,7 +191,6 @@ You can send 0..4 event values along with the event.
"
"
``Event,SingleEventValue=123``
","
.. code-block:: html
@@ -205,7 +203,6 @@ You can send 0..4 event values along with the event.
"
"
``Event,MultipleEventValues=123,456,789,999999``
","
.. code-block:: html
@@ -218,6 +215,6 @@ You can send 0..4 event values along with the event.
endon
The event value `9999`` (4) is intercepted and the rule ``Publish, ... %eventvalue1%+%eventvalue2%=[%eventvalue1%+%eventvalue2%]`` is
The event value ``9999`` (4) is intercepted and the rule ``Publish, ... %eventvalue1%+%eventvalue2%=[%eventvalue1%+%eventvalue2%]`` is
triggered, output payload to MQTT would then be ``Lets compute 123+456=579``
"
+50 -35
View File
@@ -1,16 +1,20 @@
.. These P001 commands should be moved to core (P000)...
:ref:`P000_page` |P000_status| |P000_usedby_GPIO|
:ref:`P000_page` |P000_status|
Supported hardware: |P000_usedby_GPIO|
.. csv-table::
:header: "Command", "GPIO", "Value", "Extra information"
:widths: 15, 10, 30, 45
:header: "Command (GPIO/Value)", "Extra information"
:widths: 20, 30
"
``GPIO,<gpio>,<value>``
","
0 ... 16
","
``GPIO,<gpio>,<state>``
GPIO: 0 ... 16
State:
**2** (HIGH-Z)
**1** (HIGH)
@@ -22,33 +26,38 @@
that it will be able to detect low level relays (with high impedance, Z).
"
"
``LongPulse,<GPIO>,<value>``
","
0 ... 16
","
<state>,<duration>
``LongPulse,<GPIO>,<state>,<duration>``
GPIO: 0 ... 16
State: 1/0
Duration: 1 ... 999 S
","
**To send a *long* pulse to a certain pin.**.
A long pulse is basically the same as the plain pulse. The only difference is the time base in seconds rather than in milliseconds.
So it's more suitable for longer duration. Example to send an active high (1) pulse on GPIO 15 for 10 minutes.
So it's more suitable for longer duration.
"
"
``LongPulse_mS,<GPIO>,<value>``
","
0 ... 16
","
<state>,<duration>
``LongPulse_mS,<GPIO>,<state>,<duration>``
GPIO: 0 ... 16
State: 1/0
Duration: 1000 ... 15000 mS
","
**To send a *long* pulse to a certain pin.**
A long pulse (mS) is the same as the regular long pulse. The only difference is the time base in milliseconds rather than in seconds.
Example to send an active high (1) pulse on GPIO 15 for 1 second.
"
"
``Pulse,<GPIO>,<value>``
","
0 ... 16
","
<state>,<duration>
``Pulse,<GPIO>,<state>,<duration>``
GPIO: 0 ... 16
State: 1/0
Duration: 0 ... 1000 mS
","
**To send a *short* pulse to a certain pin.**
Example to send an active high (1) pulse on GPIO 14 for 500 mSeconds. Pulse duration is in milliseconds. State is 1 or 0.
@@ -57,24 +66,30 @@
``PWM,<GPIO>,<state>``
``PWM,<GPIO>,<state>,<duration>``
","
0... **15**
","
0 ... 1023
GPIO: 0 ... **15**
State: 0 ... 1023
Duration: 100 ... 15000 mS (optional)
","
**To set a certain PWM level.**
If you have set a certain GPIO to a PWM level and want to use it as a regular HIGH/LOW pin you need to reset by setting the PWM level to 0.
You can use the duration (ms) parameter to create a fading.
"
"
``Servo,<value1>,<GPIO>,<value2>``
","
0 ... 16
","
value1: servo number
``Servo,<servo>,<GPIO>,<position>``
value2: position
GPIO: 0 ... **15**
Servo: 1/2
Position: -180 ... 180 (see warning below)
","
**To control a servo motor.**
We currently support a maximum of two servo motors so you can build a pan & tilt device if you like. Example to set servo 1 on GPIO 2 to a 90 degree position and servo 2 on GPIO 16 to a 45 degree position.
We currently support a maximum of two servo motors so you can build a pan & tilt device if you like.
.. warning::
Most servos are not able to turn full 360°! Normally the servos are able to go from **-90°** to **90°**, some rare servos do allow for -135° to 135°.
"
+16 -12
View File
@@ -1,26 +1,30 @@
.. These P001 commands should be moved to core (P000)...
:ref:`P000_page` |P000_status| |P000_usedby_RTTTL| (Ringtones etc.)
:ref:`P000_page` |P000_status|
Supported hardware: |P000_usedby_RTTTL| (Ringtones etc.)
.. csv-table::
:header: "Command", "GPIO", "Value", "Extra information"
:widths: 15, 10, 30, 45
:header: "Command (GPIO/Value)", "Extra information"
:widths: 20, 30
"
``tone,<gpio>,<value>``
","
12...16
","
<tone>,<duration>
``tone,<gpio>,<tone>,<duration>``
GPIO: 12 ... 16
Tone: 20 ... 13000 Hz
Duration: 100 ... 15000 S
","
You should try to use GPIO 12...16 since these generally aren't used. The recommended tone range is 20...13000 but you could try tones outside this range. Duration is set in ms.
"
"
``rtttl,<gpio>,<value>``
","
12...16
","
d=<duration>,o=<octave>,b=<tempo>,<notes...>
GPIO: 12 ... 16
Value: d=<duration>,o=<octave>,b=<tempo>,<notes...>
","
You should try to use GPIO 12...16 since these generally aren't used by ESP internal functions.
"
+1 -1
View File
@@ -87,7 +87,7 @@ Where to buy
"AliExpress","`Link 1 ($) <http://s.click.aliexpress.com/e/cg1fhDDI>`_"
"Ebay","`Link 2 ($) <http://rover.ebay.com/rover/1/711-53200-19255-0/1?ff3=4&pub=5575404073&toolid=10001&campid=5338336929&customid=&mpre=https%3A%2F%2Fwww.ebay.com%2Fitm%2FS8-0053-carbon-dioxide-infrared-CO2-sensors-FOR-SenseAir%2F112303432827%3Fhash%3Ditem1a25ce647b%3Ag%3A%7EHcAAOSw1WJZJ%7E8Y>`_"
"First Byte","`Link 3 <https://firstbyte.shop/products/s8>`_"
"First Byte","`Link 3 ($) <https://firstbyte.shop/products/s8>`_"
|affiliate|
+120
View File
@@ -100,3 +100,123 @@ There's three different released versions of ESP Easy:
":ref:`P079_page`","|P079_status|","P079"
":ref:`P080_page`","|P080_status|","P080"
":ref:`P081_page`","|P081_status|","P081"
Analog input
============
Plugins: |Plugin_Analog_input|
Color
=====
Plugins: |Plugin_Color|
Communication
=============
Plugins: |Plugin_Communication|
Display
=======
Plugins: |Plugin_Display|
Distance
========
Plugins: |Plugin_Distance|
Dust
====
Plugins: |Plugin_Dust|
Energy (AC)
===========
Plugins: |Plugin_Energy_AC|
Energy (DC)
===========
Plugins: |Plugin_Energy_DC|
Environment
===========
Plugins: |Plugin_Environment|
Extra IO
========
Plugins: |Plugin_Extra_IO|
Gases
=====
Plugins: |Plugin_Gases|
Generic
=======
Plugins: |Plugin_Generic|
Gesture
=======
Plugins: |Plugin_Gesture|
Gyro
====
Plugins: |Plugin_Gyro|
Hardware
========
Plugins: |Plugin_Hardware|
Keypad
======
Plugins: |Plugin_Keypad|
Light/Lux
=========
Plugins: |Plugin_Light_Lux|
Motor
=====
Plugins: |Plugin_Motor|
Notify
======
Plugins: |Plugin_Notify|
Output
======
Plugins: |Plugin_Output|
Regulator
=========
Plugins: |Plugin_Regulator|
RFID
====
Plugins: |Plugin_RFID|
Switch input
============
Plugins: |Plugin_Switch_input|
Weight
======
Plugins: |Plugin_Weight|
+6 -4
View File
@@ -54,20 +54,22 @@ Commands are divided into several classes:
:blue:`Special` can be used from any source
Commands listed (core commands and plugin commands)
---------------------------------------------------
Commands listed
---------------
(core commands and plugin commands)
.. include:: ../Plugin/P000_commands.rst
Internal GPIO handling and ringtones
------------------------------------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. include:: ../Plugin/P001_commands_GPIO.rst
.. include:: ../Plugin/P001_commands_RTTTL.rst
Plugin based commands
---------------------
~~~~~~~~~~~~~~~~~~~~~
.. .. include:: ../Plugin/P002_commands.rst
+1 -1
View File
@@ -44,7 +44,7 @@
border-style: solid;
border-color: #3492E2;
color: #3492E2;
padding: 4px 7px;
padding: 1px 7px;
margin-top: 8px;
margin-bottom: 8px;
border-radius: 3px;
+27 -2
View File
@@ -306,13 +306,38 @@ rst_prolog = """
.. |removed| replace:: :red:`removed`
.. |fixed| replace:: :purple:`fixed`
.. |Plugin_Analog_input| replace:: :ref:`P002_page`, :ref:`P025_page`, :ref:`P060_page`
.. |Plugin_Color| replace:: :ref:`P050_page`, :ref:`P066_page`
.. |Plugin_Communication| replace:: :ref:`P016_page`, :ref:`P020_page`
.. |Plugin_Display| replace:: :ref:`P012_page`, :ref:`P023_page`, :ref:`P036_page`, :ref:`P057_page`, :ref:`P073_page`, :ref:`P075_page`
.. |Plugin_Distance| replace:: :ref:`P013_page`
.. |Plugin_Dust| replace:: :ref:`P018_page`, :ref:`P053_page`, :ref:`P056_page`
.. |Plugin_Energy_AC| replace:: :ref:`P076_page`, :ref:`P077_page`, :ref:`P078_page`
.. |Plugin_Energy_DC| replace:: :ref:`P027_page`
.. |Plugin_Environment| replace:: :ref:`P004_page`, :ref:`P005_page`, :ref:`P006_page`, :ref:`P014_page`, :ref:`P024_page`, :ref:`P028_page`, :ref:`P030_page`, :ref:`P031_page`, :ref:`P032_page`, :ref:`P034_page`, :ref:`P039_page`, :ref:`P047_page`, :ref:`P051_page`, :ref:`P068_page`, :ref:`P069_page`, :ref:`P072_page`
.. |Plugin_Extra_IO| replace:: :ref:`P007_page`, :ref:`P009_page`, :ref:`P011_page`, :ref:`P022_page`
.. |Plugin_Gases| replace:: :ref:`P049_page`, :ref:`P052_page`
.. |Plugin_Generic| replace:: :ref:`P003_page`, :ref:`P026_page`, :ref:`P033_page`, :ref:`P037_page`, :ref:`P081_page`
.. |Plugin_Gesture| replace:: :ref:`P064_page`
.. |Plugin_Gyro| replace:: :ref:`P045_page`
.. |Plugin_Hardware| replace:: :ref:`P046_page`
.. |Plugin_Keypad| replace:: :ref:`P058_page`, :ref:`P061_page`, :ref:`P062_page`, :ref:`P063_page`
.. |Plugin_Light_Lux| replace:: :ref:`P010_page`, :ref:`P015_page`, :ref:`P074_page`
.. |Plugin_Motor| replace:: :ref:`P048_page`, :ref:`P079_page`
.. |Plugin_Notify| replace:: :ref:`P055_page`, :ref:`P065_page`
.. |Plugin_Output| replace:: :ref:`P029_page`, :ref:`P038_page`, :ref:`P041_page`, :ref:`P042_page`, :ref:`P043_page`, :ref:`P070_page`
.. |Plugin_Regulator| replace:: :ref:`P021_page`
.. |Plugin_RFID| replace:: :ref:`P008_page`, :ref:`P017_page`, :ref:`P040_page`
.. |Plugin_Switch_input| replace:: :ref:`P001_page`, :ref:`P019_page`, :ref:`P059_page`, :ref:`P080_page`
.. |Plugin_Weight| replace:: :ref:`P067_page`
.. |P000_name| replace:: :cyan:`Internal`
.. |P000_type| replace:: :cyan:`GPIO handling`
.. |P000_typename| replace:: :cyan:`Internal GPIO handling`
.. |P000_status| replace:: :green:`NORMAL`
.. |P000_github| replace:: P001_Switch.ino (will be removed from plugin and added to core)
.. |P000_github| replace:: P001_Switch.ino
.. _P000_github: https://github.com/letscontrolit/ESPEasy/blob/mega/src/_P001_Switch.ino
.. |P000_usedby_GPIO| replace:: :ref:`P000_Relay_page`
.. |P000_usedby_GPIO| replace:: :ref:`P000_Relay_page`, :ref:`P000_Servo_motor_page`
.. |P000_usedby_RTTTL| replace:: :ref:`P000_Buzzer_page`, :ref:`P000_Piezo_element_page`, :ref:`P000_Speaker_page`
.. |P000_shortinfo| replace:: The ESP module can control things with it's build-in GPIO output pins. We can turn these on or off or we can set these pins to a special pulse modulated value (PWM output). And it's also possible to send short pulses (single pulse) to one of these pins to control specific devices that are switched with a single short high or low signal.
.. |P000_maintainer| replace:: Core
+8 -7
View File
@@ -18,19 +18,13 @@ Welcome to ESP Easy's documentation!
Tools/Tools.rst
WiFi/WiFi.rst
.. toctree::
:glob:
:hidden:
Controller/C*
Plugin/P*
.. raw:: latex
\appendix
.. toctree::
:maxdepth: 2
:caption: Appendix
Participate/Documentation.rst
@@ -38,6 +32,13 @@ Welcome to ESP Easy's documentation!
Reference/SystemVariable.rst
Reference/ChangeLog.rst
.. toctree::
:glob:
:hidden:
Controller/C*
Plugin/P*
Indices and tables
==================