forked from letscontrolit/ESPEasy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request letscontrolit#5218 from TD-er/feature/P178_LU9685
[LU9685] Add P178_LU9685 (letscontrolit#5216)
- Loading branch information
Showing
13 changed files
with
622 additions
and
76 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,88 @@ | ||
.. include:: ../Plugin/_plugin_substitutions_p17x.repl | ||
.. _P178_page: | ||
|
||
|P178_typename| | ||
================================================== | ||
|
||
|P178_shortinfo| | ||
|
||
Plugin details | ||
-------------- | ||
|
||
Type: |P178_type| | ||
|
||
Name: |P178_name| | ||
|
||
Status: |P178_status| | ||
|
||
GitHub: |P178_github|_ | ||
|
||
Maintainer: |P178_maintainer| | ||
|
||
Used libraries: |P178_usedlibraries| | ||
|
||
Introduction | ||
------------ | ||
|
||
The ``LU9685`` is being sold on a PCB as a 16 channel servo controller by various sellers like AliExpress, E-bay, etc. | ||
However the chip itself is capable of addressing upto 20 servos. | ||
|
||
These "16-channel"-boards resemble the design of many older PCA9685 boards and many sellers claim this ``LU9685`` is a direct replacement for the ``PCA9685``. | ||
However, these are quite different chips. | ||
|
||
The ``LU9685`` is specifically aimed to be used as a servo controller chip as it can only set the PWM pulse per pin between 0.5 ms .. 2.5 ms. | ||
|
||
The PWM frequency can be set from 20 Hz - 300 Hz. | ||
|
||
Supported hardware | ||
------------------ | ||
|
||
|P178_usedby| | ||
|
||
Configuration | ||
------------- | ||
|
||
* **Name**: Required by ESPEasy, must be unique among the list of available devices/tasks. | ||
|
||
* **Enabled**: The device can be disabled or enabled. When not enabled the device should not use any resources. | ||
|
||
I2C options | ||
^^^^^^^^^^^ | ||
|
||
The available I2C settings here depend on the build used. | ||
|
||
Device Settings | ||
^^^^^^^^^^^^^^^ | ||
|
||
* **PWM Frequency**: The frequency of sending the PWM pulses. Range 20 .. 255 Hz. | ||
|
||
|
||
Commands available | ||
^^^^^^^^^^^^^^^^^^ | ||
|
||
.. include:: P178_commands.repl | ||
|
||
.. Events | ||
.. ~~~~~~ | ||
.. .. include:: P178_events.repl | ||
Change log | ||
---------- | ||
|
||
.. versionchanged:: 2.0 | ||
... | ||
|
||
|added| | ||
Major overhaul for 2.0 release. | ||
|
||
.. versionadded:: 1.0 | ||
... | ||
|
||
|added| | ||
Initial release version. | ||
|
||
|
||
|
||
|
||
|
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,65 @@ | ||
.. csv-table:: | ||
:header: "Command", "Extra information" | ||
:widths: 20, 30 | ||
|
||
" | ||
``lu9685,servo,<pin>,<angle>`` | ||
|
||
``[<taskname>].lu9685,servo,<pin>,<angle>`` | ||
|
||
pin: 0 ... 19 or ``all`` | ||
|
||
angle: 0 ... 180 (``-1`` will disable the output on the given pin) | ||
|
||
"," | ||
**Set specified pin to output a pulse duration for a servo** | ||
|
||
The pulse width from 0.5 msec ... 2.5 msec is interpreted by a servo as an angle from 0 ... 180 degree. | ||
Some servos have a range of 270 degree. However the input value for this command is still from 0 ... 180. | ||
|
||
When ``all`` is used as pin, these commands refer to all pins on the addressed LU9685. | ||
|
||
Examples: | ||
|
||
* ``lu9685,servo,all,123`` | ||
* ``lu9685,servo,1,123`` | ||
" | ||
" | ||
``lu9685,enable,<pin>`` | ||
|
||
``lu9685,disable,<pin>`` | ||
|
||
``[<taskname>].lu9685,enable,<pin>`` | ||
|
||
``[<taskname>].lu9685,disable,<pin>`` | ||
|
||
pin: 0 ... 19 or ``all`` | ||
"," | ||
**Enable or disable pulse output on specified pin(s)** | ||
|
||
``enable`` will restore the last set 'angle' to be output on the specified pin(s). | ||
|
||
``disable`` will stop outputting the servo pulse on the specified pin(s). | ||
" | ||
" | ||
``[<taskname>].lu9685,setrange,<startpin>,<startVarIndex>,<nrPins>`` | ||
|
||
startpin: 0 ... 19 or ``all`` | ||
|
||
startVarIndex: first index of a variable referring to 'N' similar to ``[int#N]`` | ||
|
||
nrPins: 1 ... 19 | ||
"," | ||
**Set a range of pins to output a value as defined in variables.** | ||
|
||
This command will copy the set values of a sequence of variables to a set range of pins. | ||
|
||
If a referred variable was never set, the matching pin will be disabled. | ||
|
||
This command will set all pins in a single I2C call, which limits communication overhead and also results in all pins being set at the same time. | ||
|
||
.. note:: This will only update the pins when calling this command. It is not a continuous synchronisation between variables and pins. | ||
|
||
For example: | ||
``lu9685,setrange,10,1000,2`` Will use the values stored in ``[int#1000]`` and ``[int#1001]`` to set pins ``10`` and ``11``. | ||
" |
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
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
Oops, something went wrong.