Clarify using different <x> for each GPIO

Michael Ingraham 2019-08-10 12:13:27 -04:00
parent feaaaf1880
commit 922d87c62f
1 changed files with 6 additions and 6 deletions

@ -4,27 +4,27 @@ Some smart devices have additional functionality which may be handled by codes s
If your device is similar to the existing built-in module (e.g., a particular MCU or power monitoring algorithm) it is best to use that as a starting point. When you are not sure which module is suitable for your device, use `Generic module (18)`. Once you have selected the module type and saved the configuration, return to the module type configuration dialog.
1. Assign every available GPIO (excluding, at first, "dedicated" GPIO such as Tx/Rx & GPIO0/GPIO2, etc.) to one of the `Relay<x>` relays.
1. Assign every available GPIO (excluding, at first, "dedicated" GPIO such as Tx/Rx & GPIO0/GPIO2, etc.) to successive `Relay<x>` components.
_a._ Save the configuration. Once the device reboots, use the web GUI virtual buttons to find which of the buttons assigned to GPIO actually control relays and LEDs on the device.
- If you are unable to control some of the relays or LEDs on the device, they may be attached to the "dedicated" GPIO. Assign those GPIO to an unused `Relay<x>` and repeat step _1a_.
_b._ Once you have found which GPIO control which relays and LEDs, set these "active" GPIO to associate them with the corresponding `Relay<x>`, `LED<x>`, or `LEDLink`. Proper operation may dictate the use regular or inverted (`Relay<x>i`/`LED<x>i`/`LEDLinki`) settings.
_b._ Once you have found which GPIO control which relays and LEDs, set these "active" GPIO to associate them with the corresponding `Relay<x>`, `LED<x>`, or `LEDLink`. Proper operation may dictate the use regular or inverted (i.e., `Relay<x>i`/`LED<x>i`/`LEDLinki`) settings.
2. Now, assign every remaining GPIO (excluding, once again, remaining "dedicated" like Tx/Rx & GPIO0/GPIO2, etc.) to `Switch`es.
2. Now, assign every remaining GPIO (excluding, once again, remaining "dedicated" like Tx/Rx & GPIO0/GPIO2, etc.) to successive `Switch<x>` components.
_a._ Save the configuration. Once the device reboots, use the web GUI Console to run the `Status 8` (sensors) command. This will display the current state of each GPIO.
_b._ Then, while pressing each button, display `Status 8` again. Whichever GPIO changes state from what was shown in step _2a_ is the GPIO connected to the button.
_b._ Then, while either holding down the button or having flipped the position of the switch, display `Status 8` again. Whichever GPIO changes state from what was shown in step _2a_ is the GPIO connected to the input.
- If none of the GPIO change state, then assign the "dedicated" GPIO and retry step _2a_.
_c._ Once you have found which GPIO are connected to each button, change the GPIO setting in the configuration to a `Button<x>`. You may need to determine whether the internal pull-up is used or not. If so, select `Button<x>`_**n**_. _**n**_ indicates no pull-up or normally-closed.
_c._ Once you have found which GPIO are connected to each input, change the GPIO setting in the configuration to a `Button<x>` or `Switch<x>` according to your input component or use case. Proper operation may dictate the use regular or inverted (i.e., `Switch<x>i`/`Button<x>i`) settings. For buttons, you may need to determine whether the internal pull-up is used or not. If so, select `Button<x>`_**n**_, where _**n**_ indicates no pull-up.
- See [Using a physical pushbutton with single press, double press, and hold](https://github.com/arendst/Sonoff-Tasmota/wiki/Rule-cookbook#16-using-an-external-button-with-single-press---double-press-and-hold) to control multiple devices with one button.
3. Once you have determined which pins your device uses, set any remaining pins to `None`.
3. Once you have determined which GPIO your device uses, set any remaining GPIO to `None`.
- Save the configuration.