LED pin can be used to emulate 5key OSD joystick for OSD camera pin, while still driving ws2812 LEDs (shared functionality).
See LED pin PWM for more details.
Note that for cameras which support RuncamDevice protocol, there is alternative functionality using serial communication: Runcam device
Also special adapters exist to convert RuncamDevice protocol to OSD Joystick: Runcam control adapter
Camera internal resistance seems to be 47kOhm or 9kOhm depending on camera model.
Each key effectively turns on voltage divider. Voltage is sensed by the camera and is compared to the list of keys voltages with some threshold.
Key voltage has to be held for at least 200ms.
To simulate 5key joystick, it is sufficient to generate correct voltage on camera OSD pin.
set led_pin_pwm_mode=shared_high
set osd_joystick_enabled=on
Also enable "Multi-color RGB LED Strip support" in Configuration tab.
We use LED pin PWM functionality with RC filter to generate voltage:
RC Filter can be soldered on a small piece of PCB:
If default voltages does not work with your camera model, then you have to measure voltages and find out corresponding PWM duty ratios.
- Connect 5keys joystick to camera.
- Measure voltages on OSD pin while each key is pressed.
- Connect camera to FC throught RC filter as shown on schematix above.
- Enable OSD Joystick emulation (see "Enabling OSD Joystick emulation" above)
- Use cli command
led_pin_pwm <value>
, value = 0...100 to find out PWM values for each voltage. - Specify PWM values in configuration and save:
set osd_joystick_down=0
set osd_joystick_up=48
set osd_joystick_left=63
set osd_joystick_right=28
set osd_joystick_enter=75
save
Emulation can be enabled in unarmed state only.
OSD Joystick emulation mode is enabled using the following stick combination:
Throttle:CENTER Yaw:RIGHT
Than camera OSD can be navigated using right stick. See Controls for all stick combinations.
Note that the same stick combination is used to enable 5keys joystick emulation with RuncamDevice protocol.
Mode is exited using stick combination:
Throttle:CENTER Yaw:LEFT
There are 3 RC Boxes which can be used in armed and unarmed state:
- Camera 1 - Enter
- Camera 2 - Up
- Camera 3 - Down
Other keys can be emulated using Programming framework ( see LED pin PWM for more details ).
There is ~2 seconds LOW pulse during boot sequence, which corresponds to DOWN key. Fortunately, cameras seem to ignore any key events few seconds after statup.