Difference between revisions of "Module/Servo switch"
m (added modules category) |
(fix some errors) |
||
(One intermediate revision by one other user not shown) | |||
Line 13: | Line 13: | ||
Now you only have to declare a servo in your airframe.xml that you | Now you only have to declare a servo in your airframe.xml that you | ||
want to use. | want to use. | ||
By default the servo_switch module looks for a servo called SWITCH. | By default the servo_switch module looks for a servo called SWITCH. | ||
Line 38: | Line 35: | ||
<define name="SERVO_SWITCH_ON_VALUE" value="1100"/> | <define name="SERVO_SWITCH_ON_VALUE" value="1100"/> | ||
<define name="SERVO_SWITCH_OFF_VALUE" value="1900"/> | <define name="SERVO_SWITCH_OFF_VALUE" value="1900"/> | ||
<define name="SERVO_SWITCH_SERVO" value=" | <define name="SERVO_SWITCH_SERVO" value="HATCH"/> | ||
</load> | </load> | ||
</modules> | </modules> | ||
Line 44: | Line 41: | ||
}} | }} | ||
Of course you only have to set these parameters here If you do not | Of course you only have to set these parameters here If you do not | ||
want to use the DEFAULT servo (SWITCH) or the default on/off values. | want to use the DEFAULT servo (SWITCH) or the default on/off values. Switch value will not go outside the range defined on the servo | ||
=== Calling from Flight Plan === | === Calling from Flight Plan === | ||
In your flight plan you just call the | In your flight plan you just call the macro defined in servo_switch.h | ||
<source lang="xml"><call fun="ServoSwitchOn()"/></source> | <source lang="xml"><call fun="ServoSwitchOn()"/></source> | ||
or | or | ||
Line 55: | Line 52: | ||
=== Buttons in the GCS === | === Buttons in the GCS === | ||
To get buttons for the servo switch module in the GCS add | To get buttons for the servo switch module in the GCS add conf/settings/modules/servo_switch.xml to the settings files of your aircraft. | ||
[[Category:Modules]] | [[Category:Modules]] |
Latest revision as of 15:46, 29 August 2013
This module allows you to easily control a servo output like a switch (e.g. for a hatch, cam trigger, etc) via Flight Plan and GCS (not via RC!).
To use it load the servo_switch module:
File: conf/airframes/myplane.xml |
<modules>
...
<load name="servo_switch.xml"/>
</modules>
|
Now you only have to declare a servo in your airframe.xml that you want to use.
By default the servo_switch module looks for a servo called SWITCH. The switch on value is 2000us and switch off is 1000us by default. e.g. in my airframe file I have:
File: conf/airframes/myplane.xml |
<servos>
....
<servo name="SWITCH" no="7" min="1000" neutral="1500" max="2000"/>
</servos>
|
If you want to use a different servo/values you can set that in the modules section, e.g. for a servo named HATCH:
File: conf/airframes/myplane.xml |
<modules>
<load name="servo_switch.xml">
<define name="SERVO_SWITCH_ON_VALUE" value="1100"/>
<define name="SERVO_SWITCH_OFF_VALUE" value="1900"/>
<define name="SERVO_SWITCH_SERVO" value="HATCH"/>
</load>
</modules>
|
Of course you only have to set these parameters here If you do not want to use the DEFAULT servo (SWITCH) or the default on/off values. Switch value will not go outside the range defined on the servo
Calling from Flight Plan
In your flight plan you just call the macro defined in servo_switch.h
<call fun="ServoSwitchOn()"/>
or
<call fun="ServoSwitchOff()"/>
respectively.
Buttons in the GCS
To get buttons for the servo switch module in the GCS add conf/settings/modules/servo_switch.xml to the settings files of your aircraft.