2,732
edits
Red Leader (talk | contribs) m (Red Leader moved page Arduino to Howto:Use Arduino with FlightGear: Most of the page is about using Arduino with FlightGear, so make it more befitting.) |
Red Leader (talk | contribs) (Partial clean-up/copy-edit) |
||
Line 1: | Line 1: | ||
Thanks to [[FlightGear]]'s [[generic protocol]], hardware can easily interface with FlightGear. This hardware can be used to improve the immersion and/or realism of the simulation. Arduino is no exception. | |||
== About Arduino == | |||
'''[http://www.arduino.cc/ Arduino]''' is an open-source electronics prototyping platform based on flexible, easy-to-use [[:Category:Hardware|hardware]] (consisting of a board designed around an 8-bit or a 32-bit microcontroller) and software [http://arduino.cc/en/main/software Arduino IDE]). | '''[http://www.arduino.cc/ Arduino]''' is an open-source electronics prototyping platform based on flexible, easy-to-use [[:Category:Hardware|hardware]] (consisting of a board designed around an 8-bit or a 32-bit microcontroller) and software [http://arduino.cc/en/main/software Arduino IDE]). | ||
== | == Controlling Flightgear with Arduino == | ||
This example demonstrates the use of a switch and a potentiometer to control the [[Property Tree]] | |||
=== Equipment and software === | === Equipment and software === | ||
This example uses the following components and software: | |||
This example uses following components and software: | * [[Changelog_3.2|FlightGear 3.2]] or higher | ||
* [[Changelog_3.2|FlightGear 3.2]] | * [[FlightGear Launch Control]] (or FGRun) | ||
* [[ | |||
* Arduino UNO | * Arduino UNO | ||
* Linux (Ubuntu 14.04) | * Linux (Ubuntu 14.04) | ||
* On/off switch | * On/off switch | ||
* Potentiometer | * Potentiometer | ||
* | * [[Cessna 172P|Cessna 172P Skyhawk]] (default aircraft) | ||
===Input protocol file=== | === Input protocol file === | ||
Input protocol file is used to specify how serial information is read by Flightgear. In Ubuntu protocol files are found in: | |||
<tt>''/usr/share/games/flightgear/protocol''</tt> directory. | |||
==== Protocol file structure ==== | |||
" | Create <tt>''controltest.xml''</tt> file in your protocol folder and paste code from below to it. | ||
<syntaxhighlight land="xml"> | |||
<?xml version="1.0"?> | |||
<PropertyList> | |||
<generic> | |||
< | <input> | ||
<line_separator>\n</line_separator> | |||
<var_separator>,</var_separator> | |||
<chunk> | |||
<name>Strobe</name> | |||
<node>/controls/lighting/strobe</node> | |||
<type>bool</type> | |||
</chunk> | |||
<chunk> | |||
<name>Throttle</name> | |||
<node>/controls/engines/engine/throttle</node> | |||
<type>float</type> | |||
</chunk> | |||
</input> | |||
</generic> | |||
</PropertyList> | |||
</syntaxhighlight> | </syntaxhighlight> | ||
See [[Generic protocol]] for a description of the various XML tags. | |||
===Wiring and coding Arduino=== | ===Wiring and coding Arduino=== |