Difference between revisions of "Module/Servo switch"

From PaparazziUAV
Jump to navigation Jump to search
(added info from mailing lists)
 
(prettify)
Line 1: Line 1:
Now you only have to declare a servo in your airframe.xml that you
This module allows you to easily control a servo (like a switch, e.g. for a hatch) via the Flight Plan and GCS.
want to use. Previously you had to set up commands, command laws as
well.
 
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.
If you want to use a different servo/values you can set that in the
modules section, e.g. for a servo named KILL:


To use it load the servo_switch module:
<pre>
<pre>
   <modules>
   <modules>
Line 15: Line 9:
</pre>
</pre>


In your flight plan you just call the makro defined in servo_switch.h
Now you only have to declare a servo in your airframe.xml that you
  <call fun="ServoSwitchOn()"/>
want to use. Previously you had to set up commands, command laws as
or
well.
  <call fun="ServoSwitchOff()"/>
 
respectively.
== Configuration ==


By default the servo_switch module looks for a servo called SWITCH.
By default the servo_switch module looks for a servo called SWITCH.
So you have to either define a servo named SWITCH or set a different
The switch on value is 2000us and switch off is 1000us by default.
servo like I indicated before.
e.g. in my airframe file I have:
e.g. in my airframe file I have:
  <servos>
  <servos>
Line 31: Line 24:




The switch on value is 2000us and switch off is 1000us by DEFAULT.
If you want to use a different servo/values you can set that in the
If you want to use a different servo/values you can set that in the
modules section, e.g. for a servo named KILL:
modules section, e.g. for a servo named KILL:
Line 39: Line 31:
     <param name="SERVO_SWITCH_SERVO"    value="SERVO_KILL"/>
     <param name="SERVO_SWITCH_SERVO"    value="SERVO_KILL"/>
  </load>
  </load>
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.
<load name="servo_switch.xml"/>
 
=== Calling from Flight Plan ===
In your flight plan you just call the makro 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 settings_servo_switch.xml to the settings files of your aircraft.

Revision as of 08:45, 22 October 2011

This module allows you to easily control a servo (like a switch, e.g. for a hatch) via the Flight Plan and GCS.

To use it load the servo_switch module:

  <modules>
    ...
    <load name="servo_switch.xml"/>
  </modules>

Now you only have to declare a servo in your airframe.xml that you want to use. Previously you had to set up commands, command laws as well.

Configuration

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:

<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 KILL:

<load name="servo_switch.xml">
   <param name="SERVO_SWITCH_ON_VALUE"  value="1100"/>
   <param name="SERVO_SWITCH_OFF_VALUE" value="1900"/>
   <param name="SERVO_SWITCH_SERVO"     value="SERVO_KILL"/>
</load>

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.

Calling from Flight Plan

In your flight plan you just call the makro 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 settings_servo_switch.xml to the settings files of your aircraft.