Devinb86
From what I understand (unless I'm not setting something up right) the chdk firmware can't natively read the pwm output from the pixhawk because the pulses are too short.
IIRC standard servo PWM output pulse widths run over a range of 1 mSec to 2 mSec. Some time ago, I did some experimenting with the CHDK high precision timer feature in Lua and found that you can almost resolve 10 steps between 1 & 2 mSec. But it's right on the hairy edge of what the camera can do and I would not recommend trying it with anything important.
So I'm trying to set up pulsed output from the relay using some of the logic switches on my taranis rx. It will not be fast acting because the logic switches from the rx can only be as short as 1ds, but could greatly expand controllability of the script in the air. So now that you have my backstory, here's what I'm trying to get it to do.
I don't know much about taranis rx units. Do I understand that you are going to ignore your Pixhawk flight controller and hook your camera's CHDK controlled USB port directly to a single relay that is in turn attached to an output from your rx unit? And you want to vary the on/off pattern coming from the relay to create a protocal that triggers your CHDK script to do different things? And your rx unit can be programmed somehow to do all of this?
I'll be utilizing two 3 position switches and one momentary switch from the taranis. < snip >
In this mode the trigger should also cause it to begin recording.
I'm not sure I would set things up exactly this way but there may be constraints on what you can do with your taranis rx unit that I am unaware of. One concern that might make it tricky is making sure the 1d sec shutter trigger pulse does not get mistaken for the 2 or 3 1ds pulses used to switch modes. It can be done but the code gets more complicated.
By the way, does 1ds mean 100 mIlliseconds?
In any case, you'll want to hack out all the code starting around line 420 where it says
====== PWM USB Pulse Controlled Functions ==========
and replace it with your own code. If you are stuck, I could probably give you a quick and dirty version to try out - debugging would be up to you though.