Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion docs/LED pin PWM.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@ Normally LED pin is used to drive WS2812 led strip. LED pin is held low, and eve

As alternative function, it is possible to generate PWM signal with specified duty ratio on the LED pin.

Feature can be used to drive external devices. It is also used to simulate [OSD joystick](OSD%20Joystick.md) to control cameras.
Feature can be used to drive external devices such as a VTX power switch. Setting the PWM duty cycle to 100% or 0% can
provide an extra PINIO pin. It is also used to simulate [OSD joystick](OSD%20Joystick.md) to control cameras.

PWM frequency is fixed to 24kHz with duty ratio between 0 and 100%:

![alt text](/docs/assets/images/led_pin_pwm.png "led pin pwm")

Note that the LED feature needs to be enabled when using the PIN in this mode (feature LED_STRIP).

There are four modes of operation:
- low
- high
Expand Down Expand Up @@ -88,3 +91,6 @@ To drive power LED with brightness control, Mosfet should be used:

![alt text](/docs/assets/images/ledpinpwmpowerled.png "led pin pwm power_led")

# Programming tab example for using the LED pin as a PINIO, such as for turning a VTX or camera on and off
!(/docs/assets/images/led-as-pinio.png "led pin as pinio")

2 changes: 1 addition & 1 deletion docs/Programming Framework.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ IPF can be edited using INAV Configurator user interface, or via CLI. To use COn
| 49 | Timer | A simple on - off timer. `true` for the duration of `Operand A` [ms]. Then `false` for the duration of `Operand B` [ms]. |
| 50 | Delta | This returns `true` when the value of `Operand A` has changed by the value of `Operand B` or greater within 100ms. ( \|ΔA\| >= B ) |
| 51 | Approx Equals (A ~ B) | `true` if `Operand B` is within 1% of `Operand A`. |
| 52 | LED Pin PWM | Value `Operand A` from [`0` : `100`] starts PWM generation on LED Pin. See [LED pin PWM](LED%20pin%20PWM.md). Any other value stops PWM generation (stop to allow ws2812 LEDs updates in shared modes). |
| 52 | LED Pin PWM | Value `Operand A` from [`0` : `100`] PWM / PINIO generation on LED Pin. See [LED pin PWM](LED%20pin%20PWM.md). Any other value stops PWM generation (stop to allow ws2812 LEDs updates in shared modes). |
| 53 | Disable GPS Sensor Fix | Disables the GNSS sensor fix. For testing GNSS failure. |
| 54 | Mag calibration | Trigger a magnetometer calibration. |
| 55 | Set Gimbal Sensitivity | Scales `Operand A` from [`-16` : `15`]
Expand Down
Binary file added docs/assets/images/led-as-pinio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.