Hi fellow wiki editors!

To help newly registered users get more familiar with the wiki (and maybe older users too) there is now a {{Welcome to the wiki}} template. Have a look at it and feel free to add it to new users discussion pages (and perhaps your own).

I have tried to keep the template short, but meaningful. /Johan G

Difference between revisions of "Howto:Use Arduino with FlightGear"

From FlightGear wiki
Jump to: navigation, search
(Display/Generic protocol Example by rubdos)
m (Update forum links)
Line 47: Line 47:
 
* [http://arduino.cc/ Official website]
 
* [http://arduino.cc/ Official website]
 
* [http://playground.arduino.cc/Main/FlightGear FlightGear Serial Communications with Arduino] (tutorial)
 
* [http://playground.arduino.cc/Main/FlightGear FlightGear Serial Communications with Arduino] (tutorial)
* [http://www.flightgear.org/forums/viewtopic.php?f=18&t=11126 Arduino LCD and FlightGear] (FlightGear forum)
+
* [http://forum.flightgear.org/viewtopic.php?f=18&t=11126 Arduino LCD and FlightGear] (FlightGear forum)
  
 
[[Category:Cockpit building]]
 
[[Category:Cockpit building]]
 
[[Category:Hardware]]
 
[[Category:Hardware]]

Revision as of 12:36, 25 October 2013

Arduino LCD panel displaying speed, heading and altitude.

Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. FlightGear's IO interface allows easy development of hardware that can improve the immersion and realism of the simulation. The output protocols allow hardware to response to simulation data (like shown in the image on the right), while the input protocol allows FlightGear to reply to hardware events (eg. on the press of a button).

Display/Generic protocol Example by rubdos

Rubdos (Ruben De Smet) has built an example using the Generic Protocol and an Arduino Mega 2560. The code used to control the Arduino with generic protocol was:

<?xml version="1.0"?>
<PropertyList>
   <generic>
       <output>
           <binary_mode>false</binary_mode>
           <line_separator>newline</line_separator>
           <var_separator>newline</var_separator>
           <preamble></preamble>
           <postamble></postamble>
           <chunk>
               <name>Altitude</name>
               <node>/position/altitude-ft</node>
               <type>integer</type>
               <format>altitude=%i</format>
           </chunk>
           <chunk>
               <name>RPM</name>
               <node>/engines/engine/rpm</node>
               <type>integer</type>
               <format>rpm=%i</format>
           </chunk>
       </output>
   </generic>
</PropertyList>

It is a simple plaintext protocol, which can easily be parsed by an Arduino. The code used on the Arduino is available on github as a gist: [1]

As hardware, five seven segment displays were used, multiplexed straight on the Arduino device. In production, you'd rather use some 74HC595 or other shift register chips to drive them, to unload the Arduino and have more current. A demo is uploaded to youtube, with voiceover in which the display shows the RPM of the first engine of (the single engine) DR400: [2]

Related content

External links